diff --git a/NEWS b/NEWS index ba92740d7c..4bda0b2977 100644 --- a/NEWS +++ b/NEWS @@ -159,11 +159,9 @@ CHANGES WITH 247 in spe: to the service. * Timer units gained a new FixedRandomDelay= boolean setting. If - enabled the random delay configured with RandomizedDelaySec= is - hashed from the unit name, system identity, and execution context, so - that always the same offset is used for the same unit on the same - system run in the same context, in a way that is stable across system - reboots. + enabled, the random delay configured with RandomizedDelaySec= is + selected in a way that is stable on a given system (though still + different for different units). * Socket units gained a new setting Timestamping= that takes "us", "ns" or "off". This controls the SO_TIMESTAMP/SO_TIMESTAMPNS socket diff --git a/man/systemd.timer.xml b/man/systemd.timer.xml index 7c1a4917e5..9fe7ff3255 100644 --- a/man/systemd.timer.xml +++ b/man/systemd.timer.xml @@ -240,44 +240,41 @@ RandomizedDelaySec= - Delay the timer by a randomly selected, evenly - distributed amount of time between 0 and the specified time - value. Defaults to 0, indicating that no randomized delay - shall be applied. Each timer unit will determine this delay - randomly before each iteration, and the delay will simply be - added on top of the next determined elapsing time. This is - useful to stretch dispatching of similarly configured timer - events over a certain amount time, to avoid that they all fire - at the same time, possibly resulting in resource - congestion. Note the relation to - AccuracySec= above: the latter allows the - service manager to coalesce timer events within a specified - time range in order to minimize wakeups, the former does the - opposite: it stretches timer events over a time range, to make - it unlikely that they fire simultaneously. If - RandomizedDelaySec= and - AccuracySec= are used in conjunction, first - the randomized delay is added, and then the result is - possibly further shifted to coalesce it with other timer - events happening on the system. As mentioned above - AccuracySec= defaults to 1min and - RandomizedDelaySec= to 0, thus encouraging - coalescing of timer events. In order to optimally stretch - timer events over a certain range of time, make sure to set - RandomizedDelaySec= to a higher value, and - AccuracySec=1us. + Delay the timer by a randomly selected, evenly distributed amount of time between 0 + and the specified time value. Defaults to 0, indicating that no randomized delay shall be applied. + Each timer unit will determine this delay randomly before each iteration, and the delay will simply + be added on top of the next determined elapsing time, unless modified with + FixedRandomDelay=, see below. + + This setting is useful to stretch dispatching of similarly configured timer events over a + certain time interval, to prevent them from firing all at the same time, possibly resulting in + resource congestion. + + Note the relation to AccuracySec= above: the latter allows the service + manager to coalesce timer events within a specified time range in order to minimize wakeups, while + this setting does the opposite: it stretches timer events over an interval, to make it unlikely that + they fire simultaneously. If RandomizedDelaySec= and + AccuracySec= are used in conjunction, first the randomized delay is added, and + then the result is possibly further shifted to coalesce it with other timer events happening on the + system. As mentioned above AccuracySec= defaults to 1 minute and + RandomizedDelaySec= to 0, thus encouraging coalescing of timer events. In order to + optimally stretch timer events over a certain range of time, set + AccuracySec=1us and RandomizedDelaySec= to some higher value. + FixedRandomDelay= - Takes a boolean argument. If true, some amount of time between 0 and - RandomizedDelaySec= is chosen and added as the delay for each timer iteration. As this - delay will not be recalculated on each run, this effectively creates a fixed offset for each iteration. - The distribution between 0 and RandomizedDelaySec= is deterministic and based on - a combination of the machine ID, whether the timer is run by the user/system manager, the service manager's - user ID, and the timer's unit name. Has no effect if - RandomizedDelaySec= is set to 0. Defaults to . + Takes a boolean argument. When enabled, the randomized offset specified by + RandomizedDelaySec= is reused for all firings of the same timer. For a given timer + unit, the offset depends on the machine ID, user identifier and timer name, which means that it is + stable between restarts of the manager. This effectively creates a fixed offset for an individual + timer, reducing the jitter in firings of this timer, while still avoiding firing at the same time as + other similarly configured timers. + + This setting has no effect if RandomizedDelaySec= is set to 0. Defaults to + .