🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#143
From: Peter Jeremy
Date: Mon, 02 Nov 2026 12:38
81 lines
5282 bytes
--nhnXmbLRyn4T+jHt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2026-Nov-02 11:25:49 +0000, 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-6=
0-second-fluctuations-in-power-grids-solved

An unwanted side-effect of precise time now being easily available
(and hence the default) everywhere :-).  There have been past issues
with synchronized wakeups from mobile phones causing network spikes.

>That indicates that we should add jitter to cron(8).

Agreed.

>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.

In the long term, I agree - I'd suggest that 16-RELEASE be either A or
C.  I'm not sure A could be MFC'd, though B definitely could be.

OTOH, I'm loath to suddenly make a significant change to cron
behaviour - I'm confident that there are systems somewhere that depend
on the current behaviour - which suggests that C should be
implemented.  Overall, I'd suggest implementing B to start with (so
jitter is optional) and MFC'ing it, then later flipping the default in
-CURRENT to A (and maybe implementing C if people find a need for it).

As a related issue, should we also come up with a cron syntax that
is less precise about when a task runs - currently the "@" variants
specify that they run at the start of whatever period is specified.
IMO, it would be useful to have a way of saying e.g. "run once an hour
but I don't care when within the hour".

--=20
Peter Jeremy

--nhnXmbLRyn4T+jHt
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQKvBAEBCgCZFiEE7rKYbDBnHnTmXCJ+FqWXoOSiCzQFAmrohFsbFIAAAAAABAAO
bWFudTIsMi41KzEuMTIsMiwzXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25z
Lm9wZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRFRUIyOTg2QzMwNjcxRTc0RTY1QzIy
N0UxNkE1OTdBMEU0QTIwQjM0AAoJEBall6Dkogs0AAIP/iuZlQbZNc+YCymvsinG
QvtmuXVf4J9pX6DPe53rVptsdGWo5Ndf5cOai/s9XdVoDi6lC1l/5kYTDS70rZYY
xGEiK29CTGHRCOCQsbiWqX+fYOQESU5o9DfFoBf2KfQsssTZAvjFxLoyMCZK4B0L
oU43D3iW0H7oWQXgBuZVO/nSa8rS7KugPS5h/I3DgRYLAnynXG2LI9WoAMtB59BJ
o+9ZgH8XuBtjIvdEZLHIBQ6dyqXj9gWBKwhqk29U105dLgGZdutsrC/OWn42nVhI
v+IN8bSmg7FO7u5nkCDq/r5NL4mIp/E6VRpDeNQ6aqSxJEcuFwypf8S2ml9ILmJ7
sn+UqlJwI5h0NjW8eU9ERjd3gz4cLf4J3t/sqCxrJM7fKUhbi94UEHO/hZqSxSFA
DHmd7ZXwsqTeLhD8JoiGkNlGsV0Is/FUGxzhMmF8KWebfgUCN1vGeJ78F/zcbC/z
Cd0ggy+yb14TY8leQZ7p73GhntmKY1a/e3vfj6gN9anvy12+Z6APz5fSQYc+tmhu
6ineZ8qlYvLmsWt/hbY4G0dYAoBAOutVJo+KNHdcN9kVGdZMExj+4rfWJT5lIBUG
+iStSRR96txAGeFikDZpn+ktkQ0arEvClvTFVqh3J22zHIvLmDAxiEq4dLA34gdv
HZPyHySxUU0nllCXcNhFmxSj
=v4e6
-----END PGP SIGNATURE-----

--nhnXmbLRyn4T+jHt--


--
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: <auiEWz_J9RX6AQdU@server.rulingia.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: Peter Jeremy <peterj@freebsd.org>
Newsgroups: muc.lists.freebsd.current
Subject: Re: Should we add jitter to cron(8) ?
Date: Mon, 2 Nov 2026 23:38:58 +1100
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-current@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <auiEWz_J9RX6AQdU@server.rulingia.com>
References: <6ae8733d.196.16f0653@critter.freebsd.dk>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
	protocol="application/pgp-signature"; boundary="nhnXmbLRyn4T+jHt"
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="11302"; mail-complaints-to="news-admin@muc.de"
X-Original-To: current@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1793623147;
	h=from:from: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;
	bh=bdV/7Zg8pAQldqCyOPzcsMCtW7pcA9FxdgK/EScAW/U=;
	b=VFvQX5e1oXm2jzqwGw1hEZRt3oFF7BowMn5zzU9qS2e+uEKB48OGjw3Bd+dZlYELqUtun3
	Vo0p3xifqDDzSSWhzf/Mrn2/YYwxu3H8EdldyIJc6c/IvhZNDVnRxOc3c7hNE3GzCfp6SW
	R1Ta7azRYrAG3jiPsYpRfTSU9LgtgVcfaMdgXjspF0o+pyq2pgjCWBd0/XqmBQ2/8SbPME
	TxEryXW7iHWfzuaSyEK8ZRq54lVxCzkoiaelJWbYTXP4pDuTpGjqxhlYU0Y5XlNU2H9ket
	2TEX9eWpd+r6NBwMp90Pe1+vovWoQ7Gg0MocIcC2QvbQmn1KctLXQd0ljNzzfg==
Precedence: list
Content-Disposition: inline
In-Reply-To: <6ae8733d.196.16f0653@critter.freebsd.dk>
X-PGP-Key: http://www.rulingia.com/keys/peter.pgp
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes