Hi folks,
I have 4 moodles running on WHM/CPanel managed web sites on the one machine. I set the cron "heartbeat" for 5 minutes for each of them and thought it was all going fine until I received complaints from the management. I have since staggered the crons to 27, 28, 29, 30 minutes each. However, I'm surprized that the load spiked to 25%CPU.
osteo osteopath.net.au 10.35 0.54 0.0
Top Process %CPU 25.0 /usr/bin/perl -w /usr/bin/GET -d http://osteopath.net.au/moodle/admin/cron.php
Machine is:
Celeron(TM) CPU 1200MHz
Memory: 1025776k
Comments?
Geoffrey
Running a whole copy of perl AND php every time won't help. Try wget, or running 'php' from the command line. Bringing down the frequency helps too, as you've done.
You can also make the cron tasks work at different times. I mean, cron for Moodle1: each hour at minutes 10, 20, 30,... for Moodle2: at minutes 13, 23, 33,... and so on.
There is a smart post about it here:
http://moodle.org/mod/forum/discuss.php?d=671#9427
There is a smart post about it here:
http://moodle.org/mod/forum/discuss.php?d=671#9427
Ah, yes, cranking up perl is a load. Unfortunately there is no lynx or wget on this server.
How do you say
perl -w /usr/bin/GET -d http://osteopath.net.au/moodle/admin/cron.php
in php on the command line?
Geoffrey
How do you say
perl -w /usr/bin/GET -d http://osteopath.net.au/moodle/admin/cron.php
in php on the command line?
Geoffrey
I guess he is telling about:
/opt/bin/php /web/moodle/admin/cron.php
That is what the "Installation intructions" in Moodle Documentation tells.
Anyway, at least in Red Hat Linux 9 hosting, I think it should be:
/usr/bin/php /home/user/public_html/moodle/admin/cron.php
Anyway, you would better confirm this with your server admin or support service before using it in your cron job.
If you are the server admin, and you have moodle in your main web directory, it would be just:
/usr/bin/php /var/www/html/moodle/admin/cron.php
/opt/bin/php /web/moodle/admin/cron.php
That is what the "Installation intructions" in Moodle Documentation tells.
Anyway, at least in Red Hat Linux 9 hosting, I think it should be:
/usr/bin/php /home/user/public_html/moodle/admin/cron.php
Anyway, you would better confirm this with your server admin or support service before using it in your cron job.
If you are the server admin, and you have moodle in your main web directory, it would be just:
/usr/bin/php /var/www/html/moodle/admin/cron.php
Just one more thing: if you want to make your cron better and silent, and do not want to get emails from it, just put:
/usr/bin/php -q /home/user/public_html/moodle/admin/cron.php >/dev/null
/usr/bin/php -q /home/user/public_html/moodle/admin/cron.php >/dev/null
Thanks for that information David. I've now
got my 4 moodles behaving better.
I'm not sure why I didn't see the php option on the moodle docs myself. I did read (skim) them several times.
got my 4 moodles behaving better.
I'm not sure why I didn't see the php option on the moodle docs myself. I did read (skim) them several times.