Weblog entry #27 for lee

Cron-related performance issues with virtual Linux
Posted by lee on Wed 7 Mar 2007 at 16:04
Tags: ,

If you're running many virtualised instances of Debian, using something like UML or Xen, you may see large performance hits during the day. This may be due to I/O intensive cron-jobs being launched on multiple instances at the same time.

You need to stagger the times for cron jobs. The first thing you need to do is edit the /etc/crontab on each of the instances. Modify the "minutes" field to something other than the default on each of the systems.

 
17 *    * * *   root    run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6    * * 7   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6    1 * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly

Then have a look at the files in /etc/cron.d/ . There may some such as "logcheck" that will benefit from being shifted a few minutes.

It's a shame that the crontab doesn't support some fuzzy/random feature to timed execution. Hopefully, if it ever evolves to eat cron, that's the sort of thing upstart will support.

 

Comments on this Entry

Posted by JulienV (86.213.xx.xx) on Wed 7 Mar 2007 at 19:11
[ Send Message | View Weblogs ]

It might be worth saying the cron daemon should be reloaded after editing /etc/crontab file: /etc/init.d/cron reload

Cheers, Julien

[ Parent | Reply to this comment ]

Posted by Arthur (66.28.xx.xx) on Thu 8 Mar 2007 at 04:53
[ Send Message | View Weblogs ]
There should be no need to restart the cron daemon, at least not Vixie's cron, as it checks at wake-up time to see if anything's changed.

[ Parent | Reply to this comment ]

Posted by JulienV (86.204.xx.xx) on Thu 8 Mar 2007 at 05:46
[ Send Message | View Weblogs ]
Ah, thanks for the tip, I didn't know!

Cheers,
Julien

[ Parent | Reply to this comment ]

User Login

Username:

Password:

[ Advanced Login ]

Register Account

Quick Site Search