Cron Jobs on Shared Hosting

Re: Cron Jobs on Shared Hosting

by Visvanath Ratnaweera -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Translators
"It is recommended that the cron is run every minute,.. Cron is a general advice. Moodle does thousands of "timed" tasks - sending forum mails after an editing delay is a simple example. The PHP language being interpreted, has no inherent timers. So repeatedly running the cron.php is the way for it to go through the to-do list. Counter-intuitively, the more often cron is called, the smaller the to-do tasks get. The 1 minute comes from the resolution of the Unix crontab.

As you observed the "house keeping" tasks are not that urgent. So 15 min interval is probably sufficient. But there is a whole group of tasks which are related to student activities. Note that in Moodle the students not only interact with the learning material and the teacher, they also interact amoung each other. Moodle is made to handle hundreds of thousands of students meeting in courses which may also have thousands of participants. Depending on how the teacher runs the course, a delay of 15 min could break the dynamics. Think of a railway station, where the clocks jump in 5 min ticks, not in 1 min ticks! But if no trains leave your railway station, even 24 h resolution for its clocks would be sufficient. ;)