🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.current
Article #154

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

#154
From: Warner Losh
Date: Mon, 02 Nov 2026 18:38
105 lines
9553 bytes
--0000000000005e9ec3065f4f7458
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Mon, Nov 2, 2026 at 4:26=E2=80=AFAM Poul-Henning Kamp <phk@phk.freebsd.d=
k> 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-6=
0-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=3D30
>
> 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 incompetenc=
e.
>
>

--0000000000005e9ec3065f4f7458
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote g=
mail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, Nov 2, =
2026 at 4:26=E2=80=AFAM Poul-Henning Kamp &lt;<a href=3D"mailto:phk@phk.fre=
ebsd.dk">phk@phk.freebsd.dk</a>&gt; wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,=
204,204);padding-left:1ex">Embedded systems using cron(8) are starting to c=
ause macroscopic<br>
effects at the top of the minute:<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <a href=3D"https://www.fz-juelich.de/en/news/ar=
chive/press-release/2026/mystery-of-60-second-fluctuations-in-power-grids-s=
olved" rel=3D"noreferrer" target=3D"_blank">https://www.fz-juelich.de/en/ne=
ws/archive/press-release/2026/mystery-of-60-second-fluctuations-in-power-gr=
ids-solved</a><br>
<br>
That indicates that we should add jitter to cron(8).<br>
<br>
I can see three ways to do it:<br>
<br>
A) By default cron(8) waits [0...N] seconds before executing commands.<br>
=C2=A0 =C2=A0This can be disabled with a command line option.<br>
=C2=A0 =C2=A0For a number of reasons which we can hash later, I suggest N=
=3D30<br>
<br>
B) Same as A), but the command line option enables jitter.<br>
<br>
C) Same as A), but with additional crontab(5) syntax to say &quot;dont<br>
=C2=A0 =C2=A0jitter this particular entry&quot;.<br>
<br>
I would argue that A is the proper choice.<br>
<br>
Comments ?<br></blockquote><div><br></div><div>I&#39;d argue A is the prope=
r=C2=A0choice, but when there&#39;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.</div><=
div><br></div><div>Warner</div><div>=C2=A0</div><blockquote class=3D"gmail_=
quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,=
204);padding-left:1ex">
-- <br>
Poul-Henning Kamp=C2=A0 =C2=A0 =C2=A0 =C2=A0| UNIX since Zilog Zeus 3.20<br=
>
phk@FreeBSD.ORG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| TCP/IP since RFC 956<br>
FreeBSD committer=C2=A0 =C2=A0 =C2=A0 =C2=A0| BSD since 4.3-tahoe<br>
Never attribute to malice what can adequately be explained by incompetence.=
<br>
<br>
</blockquote></div></div>

--0000000000005e9ec3065f4f7458--


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <CANCZdforWoYXav_mFf=WihQ7=-r5mxueY_L50cks4PjT70-LLQ@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
References: <6ae8733d.196.16f0653@critter.freebsd.dk>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: Warner Losh <imp@bsdimp.com>
Newsgroups: muc.lists.freebsd.current
Subject: Re: Should we add jitter to cron(8) ?
Date: Mon, 2 Nov 2026 11:38:27 -0700
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-current@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <CANCZdforWoYXav_mFf=WihQ7=-r5mxueY_L50cks4PjT70-LLQ@mail.gmail.com>
References: <6ae8733d.196.16f0653@critter.freebsd.dk>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0000000000005e9ec3065f4f7458"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="75426"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1793644753; h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-type:content-type:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-owner:list-unsubscribe:
	 list-subscribe:list-post; bh=FZ3iyclU9f5Z2ejDMvH86QPFx3IB45sL4/szWtPhQTA=;
	b=G1JzixmYcnIjnTKjw5fE0xZWoruYZmjquhKTq/AzFdajqXK5Dn+S8SZIDA8vr2YfNCo7hI
	M1EuIr8qLtK/60JPEVCk2++heNquaAfMVRBCzh9IBmlSP52VJJBygz8YRdKO67bESm5KDN
	cWgBEASFCCLoAjjKFc/ZhrbUokBFdd4GkinTU+6pGeWMaa+lWH2VPMpy/m0Zy8IDawSc72
	c1XjtdvwmhIHMzxk4gCze3yX3xXEp+225L+ZZBNYf6t39yS6AqULfz8W1sS0eoV9xWJrv/
	ZRmUOq/daucTXARp6ArEV671LuxCjENAlotJr/8P0q7t4QqV8a6uS+e/pEdC6Q==
X-Original-To: current@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
	dkim=pass header.d=bsdimp-com.20260707.gappssmtp.com header.s=20260707 header.b=H4KZzjZD;
	spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::1133) smtp.mailfrom=wlosh@bsdimp.com;
	dmarc=none;
	arc=pass ("google.com:s=arc-20260327:i=1")
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bsdimp-com.20260707.gappssmtp.com; s=20260707; t=1793644728; x=1794249528; darn=freebsd.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=FZ3iyclU9f5Z2ejDMvH86QPFx3IB45sL4/szWtPhQTA=;
        b=H4KZzjZDflMqzHopyShyoQZtVhlapGrNLIAGqAk1W4Om1D1AeS9ztqcv/n1DwU+B3E
         r9ghT0CAalRJPsSc1Ldr+rCfoe6v1Zc/Pr7hB77AKCXIbS0HBKTkowm7N3MuDjlkcYn5
         GZg6uZ7q9b3XArvShQyGAyOqPwxprTeSACpuq2x9yBhiwUP6LX5/IESfPHp2gPx1/QQT
         ykLRvadB3bFR4YKVl7gyoeyvgLQMYFrkcneWtMHFpEaK/5G3wG7OuBMxkxyck0autoZ6
         qV20+5kM3aKk8w+Qc3Pkp58CQs9E7Eq+hvRwvRiqM3OCkQ50xzFbX5x6DfFsqhYV0Vpc
         ATLg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793644728; x=1794249528;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=FZ3iyclU9f5Z2ejDMvH86QPFx3IB45sL4/szWtPhQTA=;
        b=WAuCxZBUplAdjggp7edbwOwMQbKdLqtMbEOfDcxEtm+fjtuV/LP8EsTwnffTKQciPB
         cg1oCScZaLOBSJ3ozcJaNMhbi2LINX61N0xSdoP7ul9oXVv48A0XcLdXFozMI7cuJaZY
         qcm/2OiGulh4RO1dgjbmkRg5xWxEaSMJywaTBh9t1RH3i2NViKvU3s6jjm32Aqu0XDFO
         sbW0r/xxtlVKFvmvT1/8eGKvNrnphR3TEirTMYRTm709TZoMcG8+OT2l6g9eAbyzCiIc
         B9xK1H+izlqzKd9zzRHwUr0Tgi+1XpK/zqDAB7IJ+18Gk/vZaI0sgO5LLKufxiPvUjos
         ZMXA==
X-Gm-Message-State: APuU4Z+Uo03aCbSJ0hggvqvh2gEsBOH34VZvX1ldn4gBKiWRyi8gzSH/
	5m4zk+ora8EjKQS+NjUmsOYuPSQj/gTULggwHWzZ18F1dA+es66nVhRwxPB04fODxzTYUBfrJBt
	+2fwOy6WVtIk2GFJHs3ho8d6ZlQSxQRBS+twDoMkEJsKMDnDHtu2dpc8=
X-Gm-Gg: AYBFou2a2xBDE7txaer/PJaooYYGQCsDrKhc/vL8qHXD8JqmUpVp3PvWdqyNlSij8Mp
	a3i66g9sAy2Ij+Huz2xIQuEWDm4FwEES59IVSXdEQLAPGK58Cb7UF8WGNvKBWtMz8c3mQOtqV1g
	tgkK8NcKI4zQrCWdW1a5KDrQGqUw3qg+wkJQq9KbNzDcUWcrbGjlVBSxQTtmwCQaMeTiBt68AFE
	LkMBmwIFFJBZ0612TW7guFNKqPlc6RtqgaxVZWAt+vvHtP698g6x9th4IeJ8KpIj6pvofHaUO4U
	E+QpfTyQ1QjthyoymHv+KpBEqlJYGuUmV5A1P6UzZLOyvvrx3ijts1jOpWxmBUSkw8+jQMyrbBv
	puCK4ZLlooOmUMn9JX8Ms8nHe6AcW1xA7YVIdzTjXoblvlFS6KjCz0XHt9AzxO6eC2w==
Precedence: list
In-Reply-To: <6ae8733d.196.16f0653@critter.freebsd.dk>
X-Gm-Features: AclHuK8oK3ROfqsJL4yrOVV5_HgH-rjrn-lV_MHreeTGvfefrtWKiCLUcPTIRoc
X-Rspamd-Queue-Id: 4jJL7r6MqQz4HmR
X-Spamd-Bar: /
X-Spamd-Result: default: False [0.00 / 15.00];
	SUBJECT_ENDS_QUESTION(1.00)[];
	ARC_ALLOW(-1.00)[google.com:s=arc-20260327:i=1];
	FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com];
	R_DKIM_ALLOW(-0.20)[bsdimp-com.20260707.gappssmtp.com:s=20260707];
	MIME_GOOD(-0.10)[multipart/alternative,text/plain];
	ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US];
	R_SPF_NA(0.00)[no SPF record];
	RCVD_COUNT_ONE(0.00)[1];
	TO_DN_SOME(0.00)[];
	MIME_TRACE(0.00)[0:+,1:+,2:~];
	MISSING_XM_UA(0.00)[];
	DMARC_NA(0.00)[bsdimp.com];
	RCPT_COUNT_TWO(0.00)[2];
	MLMMJ_DEST(0.00)[current@freebsd.org];
	FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com];
	FROM_HAS_DN(0.00)[];
	RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::1133:from];
	TO_MATCH_ENVRCPT_SOME(0.00)[];
	RCVD_TLS_LAST(0.00)[];
	PREVIOUSLY_DELIVERED(0.00)[current@freebsd.org];
	DKIM_TRACE(0.00)[bsdimp-com.20260707.gappssmtp.com:+]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes