• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] improving cron scheduling

Started by dtiberio,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtiberioTopic starter

The way crons are being run now is not the best way to do it.

You want crons to run based on how often the feed updates.

so the way to do this is to start at a low interval such as every 3600 seconds. if the cron runs and pulls in 0 new entries, the interval should be doubled to 7200 seconds. every time it runs and pulls in 0 entries, the time until it runs agin is doubled. 3600 -> 7200 -> 14400 -> 28800 etc until it hits a max which should be around 7 days.

if it does pull in entries, it will keep running every 3600 seconds. if it finds nothing, it slows down, if it continues to find new entries, it continues to run.

it is important because a site might eventually have thousands of crons running, and it is better to keep the important ones running all the time and the less busy crons running only occasionally.

I may write my own perl script to adjust the cron run times if it is not added to the script in the near future.
  •  

PHPVibe A.


Similar topics (7)