[systemd-devel] idle daemon sleep

Mantas Mikulėnas grawity at gmail.com
Tue Dec 30 22:23:51 PST 2014

On Wed, Dec 31, 2014 at 7:42 AM, Garegin Asatryan <garegin16 at gmail.com> wrote:
> In Windows 8 and later the group policy service (and maybe other services as well, I couldn't find any info on that) can go to sleep to save power. Do you think a similar feature could be implemented for systemd?
> [...]
> Group Policy background refresh starts as a scheduled task, not as a service that continuously checks to determine when it is time to run the background refresh. The scheduled task model requires less overhead processing, which creates better performance for client computers.

I'm not sure what implementation exactly you have in mind?

As far as I know, it has never done any "continuous checking" in the
first place – systemd *is* asleep most of the time, waiting on
external events to arrive via epoll. (It even had fixes added to the
kernel just so that it wouldn't need to manually re-check mtab &c.).

Even for .timer units, systemd simply sleeps until it's actually time
for the next event – like cron, or Task Scheduler for that matter.
There shouldn't be any "is it time yet?".


However, one place of improvement that comes to mind is the 'watchdog'
feature that systemd uses to ensure its services aren't stuck, by
having them check in with pid1 every now and then (that is, every 1/2
of the configured timeout). Similarly, pid1 itself can use the
hardware watchdog, although this is off by default.

That is, most of systemd's own services have WatchdogSec=1min which
causes all of them to wake up every 30 seconds. So one way to save
power would be to grep /lib/systemd/system for WatchdogSec= and
increase the interval configured. I think you could raise this to
"10min" or so, depending on the service.

Oddly, I see user/enlightenment.service having WatchdogSec=10, which
is just nuts. O_o

Mantas Mikulėnas <grawity at gmail.com>

More information about the systemd-devel mailing list