RANDOM_DELAY in crontab maps to wrong property AccuracySec instead of the correct RandomizedDelaySec

Bug #1586626 reported by Tobias Wolf
10
This bug affects 2 people
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/system-generators/systemd-crontab-generator script.

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=,
           OnStartupSec=, OnUnitActiveSec= or OnUnitInactiveSec=
           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
           consumption to suppress unnecessary CPU wake-ups. To
           get best accuracy, set this option to 1us. Note that
           the timer is still subject to the timer slack
           configured via systemd-system.conf(5)'s
           TimerSlackNSec= setting. See prctl(2) for details. To
           optimize power consumption, make sure to set this
           value as high as possible and as low as necessary.

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

Revision history for this message
Alexandre Detiste (alexandre-detiste) wrote :

This is already tracked upstream here:

https://github.com/systemd-cron/systemd-cron/issues/45

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in systemd-cron (Ubuntu):
status: New → Confirmed
Changed in systemd-cron (Ubuntu):
assignee: nobody → Alexandre Detiste (alexandre-detiste)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd-cron - 1.5.12-1

---------------
systemd-cron (1.5.12-1) unstable; urgency=medium

  * New upstream release
  * add support for RandomizedDelaySec (LP: #1586626)
  * set Rules-Requires-Root: no
  * update to Standards Version 4.1.2: switch priority to optional

 -- Alexandre Detiste <email address hidden> Fri, 08 Dec 2017 11:28:24 +0100

Changed in systemd-cron (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.