Hacker News new | ask | show | jobs
by dylan604 32 days ago
That's interesting as it is also visible with a crontab -l so that new scripts can avoid using the same second. However, if you have a farm of machines with the same hardcoded value, they will all still stampede at the same time just not at the top of the minute. By allowing a random value, their start times are slightly offset with in the minute. Is the precise 60s consistent interval really that critical or just that each machine checks once per minute-ish?
1 comments

Our configuration management system(Puppet) has function for that, fqdn_rand

give it number and you will get random value up to that number, same every run for a given host, but different per host (basically, hashed host fqdn)

add a label and you will get different number but similarly consistent. Makes it real easy to randomize run across the fleet.

Would be easy script to make.

Also systemd timers have the randomization builtin, just need to specify time

    RandomizedDelaySec=12h