Re: Should we add jitter to cron(8) ?

From: Warner Losh <imp_at_bsdimp.com>
Date: Mon, 02 Nov 2026 18:38:27 UTC
On Mon, Nov 2, 2026 at 4:26 AM Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:

> Embedded systems using cron(8) are starting to cause macroscopic
> effects at the top of the minute:
>
>
> https://www.fz-juelich.de/en/news/archive/press-release/2026/mystery-of-60-second-fluctuations-in-power-grids-solved
>
> That indicates that we should add jitter to cron(8).
>
> I can see three ways to do it:
>
> A) By default cron(8) waits [0...N] seconds before executing commands.
>    This can be disabled with a command line option.
>    For a number of reasons which we can hash later, I suggest N=30
>
> B) Same as A), but the command line option enables jitter.
>
> C) Same as A), but with additional crontab(5) syntax to say "dont
>    jitter this particular entry".
>
> I would argue that A is the proper choice.
>
> Comments ?
>

I'd argue A is the proper choice, but when there's N to run in the same
minute we run them in the same order as before and the jitter just hits the
first one.

Warner


> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>
>