Very slow cron job
Hi there,
I'm currently experiencing an issue that the cron job runs for hours which slows down the entire server. Mahara 1.4 is running and the cron job is set like:
0 * * * * php /home/www/domains/site_name/public_html/htdocs/lib/cron.php > /dev/null 2>&1
Is there anything wrong with the setting? Thanks in advance for any input.
Edits to this post:
-
François Marier
- 08 November 2011, 17:42
Re: Very slow cron job
Hi Aaron,
Ideally the Mahara cron should be set to run more often than once per hour. Most of the time, it will not do anything and return immediately (or very quickly), so we recommend running it every minute with something like:
* * * * * www-data if [ -r /usr/share/mahara/lib/cron.php ] ; then /usr/bin/php5 /usr/share/mahara/lib/cron.php >>/var/log/mahara/cron.log 2>&1 ; fi
Note that the above also logs the cron messages to a file which might help you figure out which function is taking a really long time.
Cheers,
Francois