This is the first time in a year of administering Moodle that I have had to post a new topic rather than finding the answer already here, so I hope you can help!
First of all, here's what I'm working with...
Moodle version is: 1.8.2+ (2007021520)
Active Courses: 315
Database Server: MySQL (5.0.26)
PHP Version: 5.2.0
Our cron runs at 30 minute intervals and normally only takes 5 seconds. However, when Moodle's backup runs the cron script goes from taking 5 seconds to around 5 hours, this causes a huge performance hit and the page load time sky-rockets to anywhere upto 30 seconds. The backups, which are scheduled for midnight, are frequently effecting morning performance and I regularly have to kill the process to get the page load time down for morning classes.
Yesterday I changed crontab to save the output to date stamped files so I can see what is going on. Most the files are around 70KB however the log with backing up is 30MB and has an awful lot of whitespace and blank lines in it. Also, while I was in the shell I looked at the mail for root and it was chock full of messages from the cron execution...
For one cron execution these two lines are repeated 1412 times:
PHP Notice: Undefined property: stdClass::$instances in /srv/www/htdocs/backup/backuplib.php on line 2223 PHP Warning: Invalid argument supplied for foreach() in /srv/www/htdocs/backup/backuplib.php on line 2224
With this line being repeted twice:
PHP Notice: Undefined variable: instanceid in /srv/www/htdocs/mod/wiki/backuplib.php on line 188
I have attached the cronlog and shell output to this post.
I am aware there is a performance boost between 1.8.2 and 1.8.3 but unfortunately a full upgrade is not an option at this time. This is because I have inherited Moodle from the previous guy in my role and since this version was implemented there has been numerous code tweaks and add-ons which haven't been fully documented which would be lost in the event of an upgrade. Sorry to be a pain, but our College seems to have a policy about being trailing edge; upgrades don't tend to go down well unless there is a critical security need for them.
Thank you for any help and advice you can give me. Moodle is a amazing product and I am proud to be administering it.
I.T Development Officer