Hello fine gentleman.
As an introduction to the topic, here is the output of systemd timers on a fairly new Antergos setup:
$ systemctl list-timers NEXT LEFT LAST PASSED UNIT Wed 2017-09-27 01:25:48 WAT 2min 8s left n/a n/a systemd-tmpfiles-clean.timer Thu 2017-09-28 00:00:00 WAT 22h left Wed 2017-09-27 00:00:38 WAT 1h 23min ago logrotate.timer Thu 2017-09-28 00:00:00 WAT 22h left Wed 2017-09-27 00:00:38 WAT 1h 23min ago man-db.timer Thu 2017-09-28 00:00:00 WAT 22h left Wed 2017-09-27 00:00:38 WAT 1h 23min ago shadow.timer Thu 2017-09-28 00:00:00 WAT 22h left Wed 2017-09-27 00:00:38 WAT 1h 23min ago updatedb.timer
Notice the daily traffic at 00:00 hours. This does not go unnoticed on machines like mine with middle-range HDDs and modest CPUs. And every day at 0:00 I experience a few seconds of global system slowdown.
Here are the default configurations for these timers:
$ systemctl cat logrotate.timer man-db.timer shadow.timer updatedb.timer # /usr/lib/systemd/system/logrotate.timer [Unit] Description=Daily rotation of log files Documentation=man:logrotate(8) man:logrotate.conf(5) [Timer] OnCalendar=daily AccuracySec=12h Persistent=true [Install] WantedBy=timers.target # /usr/lib/systemd/system/man-db.timer [Unit] Description=Daily man-db cache update [Timer] OnCalendar=daily AccuracySec=1d Persistent=true # /usr/lib/systemd/system/shadow.timer [Unit] Description=Daily verification of password and group files [Timer] OnCalendar=daily AccuracySec=12h Persistent=true # /usr/lib/systemd/system/updatedb.timer [Unit] Description=Daily locate database update [Timer] OnCalendar=daily AccuracySec=12h Persistent=true
So, the problem is the combination of a calendar-based activation with a large
AccuracySec value. What this means is that all these timers will always coalesce into the same moment in time within a 12 hour window (or even 1d on the case of man-db). So any two or more timers that would elapse within a 12 hour window of another will elapse at the same time and thus execute their respective service unit files.
This situation is then worsened by the fact that the calendar time
daily means the 00:00:00 of every day. So it is guaranteed all these services coalesce into a single point in time, causing the noticeable slowdown. And this is the reason
list-timers always produces an output similar to the above.
With certain type of servers, this is a good setup. But with desktops, which are the target audience of Antergos, we need to spread out these services a little so they go unnoticed by the user.
To this effect, I would suggest replacing the
AccuracySec directive with
RandomizedDelaySec and set it to a value like 5m. Meaning randomize each of the aforementioned timers elapse period within a window of 5 minutes starting at 00:00:00.
What do you think?