Hardware and performance

 
 
Picture of עומר המאירי
תשובה ל: Update on PHP-accelerators, WinCache problems
 

For me, WinCache 1.3.4 caused many problems when trying to backup/restore/import a course.

 

if you havemanaged to work it out - id'e love to know how

 

thanks

 
Average of ratings: -
Picture of Dan Marsden
Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
Group DevelopersGroup Moodle Course Creator Certificate holdersGroup Particularly helpful MoodlersGroup Translators

What Moodle version and PHP version are you running?

I've recently upgraded a Moodle 2.3 site to use PHP 5.4.7 with the latest version of wincache and it seems to be running ok (so far anyway!)

(Edited by Visvanath Ratnaweera - original submission Monday, 24 September 2012, 10:58 PM)

 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

Hey Dan,

i'm using win2008 R2,PHP 5.4.6, WinCache 1.3.4.

 

everything works fine except for when i try to backup/restore a course.

 

this doesnt happen to you at all ?

you think this might be 5.4.6 issue ? (since this is the only differebce i can see between our configurations)

 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

Upgraded to 5.4.7, Still getting this after enabling wincache:

 

error/cannot_empty_backup_temp_dir

מידע נוסף על שגיאה זו

Debug info: 
Error code: cannot_empty_backup_temp_dir 
$a contents:
Stack trace:
  • line 48 of \backup\util\helper\backup_helper.class.php: backup_helper_exception thrown
  • line 58 of \backup\util\helper\backup_helper.class.php: call to backup_helper::clear_backup_dir()
  • line 70 of \backup\moodle2\restore_stepslib.php: call to backup_helper::delete_backup_dir()
  • line 34 of \backup\util\plan\restore_execution_step.class.php: call to restore_drop_and_clean_temp_stuff->define_execution()
  • line 153 of \backup\util\plan\base_task.class.php: call to restore_execution_step->execute()
  • line 163 of \backup\util\plan\base_plan.class.php: call to base_task->execute()
  • line 157 of \backup\util\plan\restore_plan.class.php: call to base_plan->execute()
  • line 315 of \backup\controller\restore_controller.class.php: call to restore_plan->execute()
  • line 130 of \backup\import.php: call to restore_controller->execute_plan()
 
 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

Maybe you can figure out why this is returning FALSE ?

 

static public function delete_dir_contents($dir, $excludeddir='') {
        global $CFG;
 
        if (!is_dir($dir)) {
            // if we've been given a directory that doesn't exist yet, return true.
            // this happens when we're trying to clear out a course that has only just
            // been created.
            return true;
        }
        $slash = "/";
 
        // Create arrays to store files and directories
        $dir_files      = array();
        $dir_subdirs    = array();
 
        // Make sure we can delete it
        chmod($dir, $CFG->directorypermissions);
 
        if ((($handle = opendir($dir))) == false) {
            // The directory could not be opened
            return false;
        }
 
        // Loop through all directory entries, and construct two temporary arrays containing files and sub directories
        while (false !== ($entry = readdir($handle))) {
            if (is_dir($dir. $slash .$entry) && $entry != ".." && $entry != "." && $entry != $excludeddir) {
                $dir_subdirs[] = $dir. $slash .$entry;
 
            } else if ($entry != ".." && $entry != "." && $entry != $excludeddir) {
                $dir_files[] = $dir. $slash .$entry;
            }
        }
 
        // Delete all files in the curent directory return false and halt if a file cannot be removed
        for ($i=0; $i<count($dir_files); $i++) {
            chmod($dir_files[$i], $CFG->directorypermissions);
            if (((unlink($dir_files[$i]))) == false) {
                return false;
            }
        }
 
        // Empty sub directories and then remove the directory
        for ($i=0; $i<count($dir_subdirs); $i++) {
            chmod($dir_subdirs[$i], $CFG->directorypermissions);
            if (self::delete_dir_contents($dir_subdirs[$i]) == false) {
                return false;
            } else {
                if (remove_dir($dir_subdirs[$i]) == false) {
                    return false;
                }
            }
        }
 
        // Close directory
        closedir($handle);
 
        // Success, every thing is gone return true
        return true;
    }
 
Average of ratings: -
Picture of Jean-Daniel Descoteaux
Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

Can it be your ACL on moodledata folder? And are you sure your using the PHP 5.4 config in the IIS and not your previous 5.3 config?

FYI, we had issues when editing language pack with php 5.3.x and WinCache 1.1 (see http://tracker.moodle.org/browse/MDL-29228), had to disable wincache before editing the pack otherwise moodledata/lang/fr would get an access denied and language would then revert to english everywhere. I just upgrade to 5.4.7 with WinCache 1.3 and now everything is ok. After reading your post above, I did a course backup and restore and everything was fine too. For us, upgrading resolved our problems.

 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 
yes im sure. what moodle version do you have? win 2008 r2? win cache 1.3.4? can you sen me your php_wincache.dll file? email is ohameiri at gmail.com thanks!!
 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

what other extensions do you have active ?

 
Average of ratings: -
Picture of עומר המאירי
תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

maybe you can send me your php.ini file also ?

 
Average of ratings: -
Picture of Jean-Daniel Descoteaux
Re: תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

win_cache.dll = 1.3.4.0

Yep, its an english W2k8 r2 sp1with PHP 5.4.7 and MySQL 5.5.

I've install PHP 5.4 + WinCache 1.3 with Microsoft Web installer platform and then upgrade to 5.4.7 by downloading & unzipping lastest version on top of existing folder.

You can take a look at my php.ini attached, I think I've only edited the upload limit size and such, as suggested in Moodle install docs.

 
Average of ratings: -
Picture of Jean-Daniel Descoteaux
Re: תשובה ל: Re: תשובה ל: Re: תשובה ל: Re: Update on PHP-accelerators, WinCache problems
 

In the end, we had problems with WinCache too. Latest version did resolved the language pack update issue and trying a single course backup & restore did work too. However, when teacher began to dupplicate activities, they sometime had a php error regarding a folder that cannot be empty because it was locked by another process (cannot remember exact error). That seem very similar to the languages issues we had and disabling and re-enabling WinCache in IIS resolved the problem... until it happen again. So, we move to XCache instead and didn't had any issues since then. It been more than a month now and everythings run fine.

Also, we had unexpected IIS crashes sometime, once a month maybe, sometime more. Server was still up and running and no error got into PHP logs or EV, but pages just seem to stop being processed. Since we use XCache, these problems seem to have disapeared too. I cannot for sure relate these two however, but it sure look like a strange coincidence. No users have complain about performance either so, switching the PHP Accelerator to XCache help us a lot.  

 
Average of ratings:Useful (1)