<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.E-MailFormatvorlage19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Thanks to everyone sharing information. Basically that’s what I expected, too, except this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I run about 10 instances of the timer, and all 10 instances are started at the same second. My initial expectation wad that systemd might spread the instances in the 6 hour windows somehow.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Maybe starting the next instance once the previous instance had finished.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">I’m somewhat unsure about the energy saving: Will 10 jobs run simultaneously consume less power than the 10 jobs run sequentially? My guess is that the timer overhead may be negligible.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">Ulrich<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Adrian Vovk <adrianvovk@gmail.com> <br>
<b>Sent:</b> Monday, August 19, 2024 10:45 AM<br>
<b>To:</b> Andrei Borzenkov <arvidjaar@gmail.com><br>
<b>Cc:</b> Barry <barry@barrys-emacs.org>; Windl, Ulrich <u.windl@ukr.de>; Systemd Devel <systemd-devel@lists.freedesktop.org><br>
<b>Subject:</b> [EXT] Re: [systemd-devel] Re: Understanding the effect of AccuracySec=<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p>I don't have the initial email for some reason (got caught in spam filter? Idk) so I don't have the full context.<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal">On Mon, Aug 19, 2024, 03:55 Andrei Borzenkov <<a href="mailto:arvidjaar@gmail.com" target="_blank">arvidjaar@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">On Mon, Aug 19, 2024 at 10:11 AM Barry <<a href="mailto:barry@barrys-emacs.org" 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" 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" 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<o:p></o:p></p>
</blockquote>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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".<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>