Page MenuHomeFreeBSD

Consolidate random sleeps in periodic scripts
ClosedPublic

Authored by asomers on Mar 31 2017, 5:03 AM.
Tags
None
Referenced Files
F82207437: D10211.id26856.diff
Fri, Apr 26, 12:32 PM
Unknown Object (File)
Wed, Apr 17, 7:52 PM
Unknown Object (File)
Tue, Apr 16, 2:34 AM
Unknown Object (File)
Thu, Apr 11, 5:36 PM
Unknown Object (File)
Mar 22 2024, 10:59 PM
Unknown Object (File)
Mar 22 2024, 10:59 PM
Unknown Object (File)
Mar 22 2024, 10:59 PM
Unknown Object (File)
Mar 22 2024, 10:59 PM
Subscribers

Details

Summary

Consolidate random sleeps in periodic scripts

Multiple periodic scripts sleep for a random amount of time in order to
mitigate the thundering herd problem. This is bad, because the sum of multiple
uniformly distributed random variables approaches a normal distribution, so the
problem isn't mitigated as effectively as it would be with a single sleep.

This change creates a single configurable anticongestion sleep. periodic will
only sleep if at least one script requires it, and it will never sleep more
than once per invocation. It also won't sleep if periodic was run
interactively, fixing an unrelated longstanding bug.

PR: 217055
PR: 210188

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Two things to note:

  1. I have a change ready to go for sysutils/bsdstats. I haven't done ports-mgmt/pkg yet
  2. I decided not to bump FreeBSD_version, because only shell scripts care about this change, and FreeBSD_version is hard to check from shell scripts. It's easier just to check for the definition of anticongestion_sleeptime
This revision is now accepted and ready to land.Mar 31 2017, 5:44 AM
asomers edited edge metadata.

Fix anticongestion's single-sleep feature for the security runs, which run
recursively within the daily, weekly, and monthly runs.

This revision now requires review to proceed.Mar 31 2017, 8:44 PM
This revision is now accepted and ready to land.Apr 1 2017, 3:34 AM
This revision was automatically updated to reflect the committed changes.