<div dir="auto"><p dir="ltr">I don't have the initial email for some reason (got caught in spam filter? Idk) so I don't have the full context.</p><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Mon, Aug 19, 2024, 03:55 Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com" target="_blank" rel="noreferrer">arvidjaar@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 19, 2024 at 10:11 AM Barry <<a href="mailto:barry@barrys-emacs.org" rel="noreferrer noreferrer" target="_blank">barry@barrys-emacs.org</a>> wrote:<br>
><br>
><br>
><br>
> On 19 Aug 2024, at 06:55, Windl, Ulrich <<a href="mailto:u.windl@ukr.de" rel="noreferrer noreferrer" target="_blank">u.windl@ukr.de</a>> wrote:<br>
><br>
><br>
> Despite of the fact that my version of systemd does not know that setting, can you explain what the effect of AccuracySec= really is?<br>
><br>
><br>
> The docs <a href="https://www.man7.org/linux/man-pages/man5/systemd.timer.5.html" rel="noreferrer noreferrer noreferrer" target="_blank">https://www.man7.org/linux/man-pages/man5/systemd.timer.5.html</a> say this<br>
><br>
> Note that this setting is primarily a power saving option<br>
> that allows coalescing CPU wake-ups. It should not be<br>
> confused with RandomizedDelaySec= (see below) which adds a<br>
> random value to the time the timer shall elapse next and<br>
> whose purpose is the opposite: to stretch elapsing of timer<br>
> events over a longer period to reduce workload spikes. For<br>
> further details and explanations and how both settings play<br>
> together, see below.<br>
><br>
> So if you have 5 timers that expire about the same time this allows them to all run at the sane time thus saving power.<br>
<br>
It does explain why timers are run at the same time. It does not<br>
explain why "daily" + accuracy 6h runs at midnight, not close to 6am<br></blockquote></div><div dir="auto"><br></div><div dir="auto">When your timer is scheduled for 00:00 but accuracy is 6h, then systemd will try to fire the timer at 00:00 but is allowed to be up to 6 hours "late" to save power. So the timer will fire at any time between 00:00 and 06:00.</div><div dir="auto"><br></div><div dir="auto">Let's say you have another timer set to fire at 01:00 + 6hr accuracy. systemd will likely fire both timers at around 01:00. The first timer is allowed to start anywhere between 00:00 and 06:00 and the second between 01:00 and 07:00. These ranges intersect from 01:00 to 06:00, so systemd will fire both timers at some point in that range. It's free to pick exactly when and I'm not looking at the code, but I wouldn't be surprised if it'll pick a time closer to 01:00 to minimize the amount of time it's "late".</div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div>
</div>