RANDOM_DELAY in crontab maps to wrong property AccuracySec instead of the correct RandomizedDelaySec
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd-cron (Ubuntu) |
Fix Released
|
Undecided
|
Alexandre Detiste |
Bug Description
The AccuracySec property in systemd is used to aggregate timer events close together to produce less wake-ups of the system. What was added in systemd is the RandomizedDelaySec property, which should be used instead.
This is about the /lib/systemd/
Below see the extract of the man page.
AccuracySec=
Specify the accuracy the timer shall elapse with.
Defaults to 1min. The timer is scheduled to elapse
within a time window starting with the time specified
in OnCalendar=, OnActiveSec=, OnBootSec=,
and ending the time configured with AccuracySec=
later. Within this time window, the expiry time will
be placed at a host-specific, randomized, but stable
position that is synchronized between all local timer
units. This is done in order to optimize power
get best accuracy, set this option to 1us. Note that
the timer is still subject to the timer slack
optimize power consumption, make sure to set this
value as high as possible and as low as necessary.
Delay the timer by a randomly selected, evenly
time value. Defaults to 0, indicating that no
will determine this delay randomly each time it is
started, 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
to make it unlikely that they fire simultaneously. If
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
stretch timer events over a certain range of time,
make sure to set RandomizedDelaySec= to a higher
value, and AccuracySec=1us.
Changed in systemd-cron (Ubuntu): | |
assignee: | nobody → Alexandre Detiste (alexandre-detiste) |
This is already tracked upstream here:
https:/ /github. com/systemd- cron/systemd- cron/issues/ 45