NEWS,man: tweak the description of FixedRandomDelay=

Explain why this is useful, but don't describe the implementation exactly,
since we're likely to want to change details in the future.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-11-10 17:24:22 +01:00 committed by Yu Watanabe
parent a54bcb9016
commit b5e798de20
2 changed files with 33 additions and 38 deletions

8
NEWS
View File

@ -159,11 +159,9 @@ CHANGES WITH 247 in spe:
to the service. to the service.
* Timer units gained a new FixedRandomDelay= boolean setting. If * Timer units gained a new FixedRandomDelay= boolean setting. If
enabled the random delay configured with RandomizedDelaySec= is enabled, the random delay configured with RandomizedDelaySec= is
hashed from the unit name, system identity, and execution context, so selected in a way that is stable on a given system (though still
that always the same offset is used for the same unit on the same different for different units).
system run in the same context, in a way that is stable across system
reboots.
* Socket units gained a new setting Timestamping= that takes "us", "ns" * Socket units gained a new setting Timestamping= that takes "us", "ns"
or "off". This controls the SO_TIMESTAMP/SO_TIMESTAMPNS socket or "off". This controls the SO_TIMESTAMP/SO_TIMESTAMPNS socket

View File

@ -240,44 +240,41 @@
<varlistentry> <varlistentry>
<term><varname>RandomizedDelaySec=</varname></term> <term><varname>RandomizedDelaySec=</varname></term>
<listitem><para>Delay the timer by a randomly selected, evenly <listitem><para>Delay the timer by a randomly selected, evenly distributed amount of time between 0
distributed amount of time between 0 and the specified time and the specified time value. Defaults to 0, indicating that no randomized delay shall be applied.
value. Defaults to 0, indicating that no randomized delay Each timer unit will determine this delay randomly before each iteration, and the delay will simply
shall be applied. Each timer unit will determine this delay be added on top of the next determined elapsing time, unless modified with
randomly before each iteration, and the delay will simply be <varname>FixedRandomDelay=</varname>, see below.</para>
added on top of the next determined elapsing time. This is
useful to stretch dispatching of similarly configured timer <para>This setting is useful to stretch dispatching of similarly configured timer events over a
events over a certain amount time, to avoid that they all fire certain time interval, to prevent them from firing all at the same time, possibly resulting in
at the same time, possibly resulting in resource resource congestion.</para>
congestion. Note the relation to
<varname>AccuracySec=</varname> above: the latter allows the <para>Note the relation to <varname>AccuracySec=</varname> above: the latter allows the service
service manager to coalesce timer events within a specified manager to coalesce timer events within a specified time range in order to minimize wakeups, while
time range in order to minimize wakeups, the former does the this setting does the opposite: it stretches timer events over an interval, to make it unlikely that
opposite: it stretches timer events over a time range, to make they fire simultaneously. If <varname>RandomizedDelaySec=</varname> and
it unlikely that they fire simultaneously. If <varname>AccuracySec=</varname> are used in conjunction, first the randomized delay is added, and
<varname>RandomizedDelaySec=</varname> and then the result is possibly further shifted to coalesce it with other timer events happening on the
<varname>AccuracySec=</varname> are used in conjunction, first system. As mentioned above <varname>AccuracySec=</varname> defaults to 1 minute and
the randomized delay is added, and then the result is <varname>RandomizedDelaySec=</varname> to 0, thus encouraging coalescing of timer events. In order to
possibly further shifted to coalesce it with other timer optimally stretch timer events over a certain range of time, set
events happening on the system. As mentioned above <varname>AccuracySec=1us</varname> and <varname>RandomizedDelaySec=</varname> to some higher value.
<varname>AccuracySec=</varname> defaults to 1min and </para></listitem>
<varname>RandomizedDelaySec=</varname> 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
<varname>RandomizedDelaySec=</varname> to a higher value, and
<varname>AccuracySec=1us</varname>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><varname>FixedRandomDelay=</varname></term> <term><varname>FixedRandomDelay=</varname></term>
<listitem><para>Takes a boolean argument. If true, some amount of time between 0 and <listitem><para>Takes a boolean argument. When enabled, the randomized offset specified by
<varname>RandomizedDelaySec=</varname> is chosen and added as the delay for each timer iteration. As this <varname>RandomizedDelaySec=</varname> is reused for all firings of the same timer. For a given timer
delay will not be recalculated on each run, this effectively creates a fixed offset for each iteration. unit, the offset depends on the machine ID, user identifier and timer name, which means that it is
The distribution between 0 and <varname>RandomizedDelaySec=</varname> is deterministic and based on stable between restarts of the manager. This effectively creates a fixed offset for an individual
a combination of the machine ID, whether the timer is run by the user/system manager, the service manager's timer, reducing the jitter in firings of this timer, while still avoiding firing at the same time as
user ID, and the timer's unit name. Has no effect if other similarly configured timers.</para>
<varname>RandomizedDelaySec=</varname> is set to 0. Defaults to <option>false</option>.</para></listitem>
<para>This setting has no effect if <varname>RandomizedDelaySec=</varname> is set to 0. Defaults to
<option>false</option>.</para></listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>