upvote
Yes, using prime numbers are a good way to reduce the risk of multiple timers coinciding, for example a 10s, 30s, 60s period on a freshly restarted node / process.
reply
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?
reply
Systemd timers do this natively btw, no need to hardcode And imho are also friendlier.
reply
But systemd bad :[
reply
People slowly are getting used to it. (Less so with journalctl)
reply
BSD cron has supported jitter for decades. This is strictly a linux problem.
reply