Trying to be more nice!

4 posts / 0 new
Last post
#1 Thu, 11/08/2007 - 03:38
ADobkin

Trying to be more nice!

Some of our users are starting to complain about delays and timeouts on our server, especially on the hour and right after midnight. Let's face it, there are a huge number of tasks running out of cron, and the list has been growing as new features and new clients are added. Some of these jobs are scheduled at random times, which helps a lot, but the real resource-intensive ones are causing an impact on the system at set times every day or every hour.

I think I have a solution: Let's be nice! Instead of running these jobs at the normal priority and making the users compete with them, let's schedule them at a lower priority. In particular, the following jobs seem ripe for this treatment:

0,5,10,15,20,25,30,35,40,45,50,55 * * * * nice /etc/webmin/status/monitor.pl 0,10,20,30,40,50 * * * * nice /etc/webmin/quota/email.pl 0 * * * * nice /etc/webmin/virtual-server/bw.pl @hourly nice /etc/webmin/virtual-server/quotas.pl @daily nice /etc/webmin/virtual-server/backup.pl

For now, I have simply added the word nice in front of the command name in cron, but there may be a better way to handle this. Also, I want to make sure that the various Webmin/Virtualmin modules recognize this when automatically scheduling jobs so they don't get overwritten, or worse, duplicated with a whole second job.

Thu, 11/15/2007 - 14:31
Joe
Joe's picture

That's a good idea, and I will add an option in the next Webmin release (1.390) to nice all cron jobs. It will be in the Webmin Configuration module under Advanced Options.

--

Check out the forum guidelines!

Fri, 11/16/2007 - 01:23 (Reply to #2)
ADobkin

Sounds great, thanks Jamie!

Tue, 12/04/2007 - 05:10 (Reply to #3)
sgrayban

I use nice -n 19 for things like the backups

Topic locked