VivoDan |
06-19-2007 05:33 PM |
Quote:
Originally Posted by ismokeblunts
(Post 12626843)
I have a large amount of cronjobs running now, with more and more executing every day. My question is this, should I be spreading my tasks out to execute throughout the day? will having a shitpile of cronjobs running at the exact same time (say midnight) strain my server or anything to negative effect?
|
Yup, if you give all your cronjobs the exact same start time, they'll all be started at once at that time.
It's usually a good idea to spread your cron jobs out over time, especially if any of them are going to do anything especially CPU/disk/database intensive. Running lots of tasks at the same time that all require the same resource will generally result in a longer run time than if you ran all the same jobs sequentially, due to task switching, disk head seeking, etc.
Another option to consider would be writing a simble bash script that will run your jobs in sequence, then just run the script from cron. Call it "nightlymaintenance.sh" or something. This can make for easier management as well, since you can just update the script, instead of adding a cron job every time you add a task.
Dan.
|