Bug#373152: cron should randomize /etc/crontab to be more friendly to virtual servers

2012-05-11 Thread LordBaco
Another alternative in bash : #!/bin/bash # randomize /etc/crontab test -f /var/backups/crontab-orig || cp /etc/crontab /var/backups/crontab-orig SUM=`sum -s /etc/hostname | cut -d -f1` H=$[ 6 - ( $RANDOM % 2 ) ] M=`printf %02d $[ ( $SUM ) % 60 ] ` sed -i -e s/^[0-9]*\(.*cron\.hourly.*\)/$M\1/

Bug#373152: cron should randomize /etc/crontab to be more friendly to virtual servers

2012-05-08 Thread LordBaco
# One-liner perl -p -i -e 'if(/run-parts/) { s/^\d+/unpack(%32C*,qx{hostname -s})%60/e; s/^([\d*]+\s+)\d+/$1.($.-8)/e; }' /etc/crontab The above one-liner will randomize the minute and the hour of all run-parts lines of /etc/crontab on Debian I calculate the System V sum of the hostname modulo

Bug#373152: cron should randomize /etc/crontab to be more friendly to virtual servers

2010-04-15 Thread Christian Kastner
severity 373152 wishlist merge 373152 522419 thanks In my own experience, the only proper approach -- guaranteeing safe system loads -- is a managed solution, ie either custom crontabs for the guests or having cron jobs managed by the host (as Russell plans to do). Nevertheless, I understand the

Bug#373152: randomness only works for small servers

2008-09-19 Thread Russell Coker
If you have a many virtual servers and if the cron jobs can run for any moderate length of time then you have problems which will not be solved so easily. My current hack for one virtual server I run is to have the daily cron jobs run 30 minutes apart (as some DomUs have jobs which run for

Bug#373152: Okay randomness isn't quite right.

2008-06-19 Thread James (Mike) Conley
I shouldn't say that I implement randomness since that isn't optimal: the reason I picked IP address was that the general use is to avoid everything running at once, by using a modulo of the IP address (and optimal spreading) it meant that jobs on sequentially numbered systems would definitely not

Bug#373152: random

2008-06-03 Thread Folkert van Heusden
Maybe it's better not to randomize on ip-address but by a general random value. E.g. lrand48() (with correct srand48()) or value from /dev/urandom. That way it'll be generic solution. One could then shift -29...29 seconds. Folkert van Heusden -- MultiTail är en flexibel redskap för att fälja

Bug#373152:

2008-05-28 Thread James Mike Conley
I have a patch submitted with the maintainer that adds randomness based on the IP address. This should help with both virtual machines and large server clusters. -- Modest doubt is called the beacon of the wise. William Shakespeare

Bug#373152: cron should randomize /etc/crontab to be more friendly to virtual servers

2006-06-13 Thread Olivier Macchioni
Package: cron Version: 3.0pl1-86 Severity: normal I'm using a setting with 6 virtual Debian servers. All their system cronjobs start at the same time, which eats all the ressources of the server at the same time (especially updatedb every morning at 6:25). The servers all basically come to a