• Welcome to PHPVIBE Forums. Please log in.

[ Video Sharing CMS v4 ] randomized cron jobs

Started by dtiberio,

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dtiberioTopic starter

one problem with the cron jobs is that I tend to load lots of feeds at once, so the crons all update at the same time. I would prefer that the crons update periodically throughout the day, so users can keep seeing new content throughout the day.

one way to do this is to set the crons to run at random times, slightly different periods.

instead of 86,400, why not randomize it by 10% so some of them run at 70,000 seconds, some at 75,000, some at 90,000, etc. over the course of weeks the crons will be populating randomly throughout the day instead of all at the same time.
  •  

PHPVibe A.

If you edit the cron, you can set an new interval for it, the 86400 is set by default just to accelerate the cron adding process.

dtiberioTopic starter

I am making a suggestion you should pass on to your developers.

I have 800 crons now. you should want them to be configured as easily as possible.

you should add a feature to run the crons with more of a random time. it is not a good idea for all crons to be set at 86,400 seconds, as I explained.

in fact, my server crashed because too many phpvibe crons were running at the same time.
  •  

PHPVibe A.

Crons are heavy, they make 1 request to the api for the list and 1 request per video with the details, same the youtube importer.
By setting different runtimes they can be controled.
You can also split them, to more php file and run them from the cron tab in your admin panel, one thing i do for my website.

Similar topics (7)