disabled suspend targets = high cpu usage

Kernels & Hardware, configuring network, installing services

disabled suspend targets = high cpu usage

Postby k9us » 2016-08-04 09:36

Hello, Debian noob here. I installed Debian 8.5 on an old Pentium 3 laptop a couple of days ago. Used the netinstall iso and selected only the OpenSSH server in tasksel during install, i.e. no desktop environment, no "standard system utilities", etc. The laptop is up-to-date acording to apt-get. I've only installed two more items: UFW and a Teamspeak 3 server (the latter of which is the actual purpose for this laptop "server"). The Teamspeak server is automatically started at boot via an init.d script.

I'm having trouble with the proper configuration of the automatic suspend options. I want the laptop to be up and running 24/7 since it is basically a "server". With the default configurations, the laptop suspends a couple of minutes after boot, so naturally I ran the following, as per the documentation at https://wiki.debian.org/Suspend:

Code: Select all
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

This keeps the laptop from suspending allright, but it has the side effect of increasing CPU usage to somewhere between 70% and 100% at all times. The offending processes are systemd, dbus-daemon, systemd-journal, and systemd-logind.

I've checked journalctl -f. Every 30 seconds it spews out hundreds of these:

Code: Select all
systemd-logind[520]: Suspending...
systemd-logind[520]: Failed to execute operation: Unit suspend.target is masked.

I've tried to circumvent this by playing around with the various options in /etc/systemd/logind.conf. Currently the following options are set:

Code: Select all

... but none of this seems to have any effect with regards to the seemingly endless loop of the laptop trying to suspend itself.

So, my question is how to properly configure this laptop to be up and running 24/7 without having to deal with the CPU issue? Again, I'm a Debian noob so I'm not sure how to proceed. What else can I do to further troubleshoot this matter? What am I missing?

Code: Select all
$ cat /etc/issue
Debian GNU/Linux 8 \n \l

$ cat /etc/debian_version

$ hostnamectl
Icon name: computer-laptop
Chassis: laptop
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 3.16.0-4-686-pae
Architecture: x86
Posts: 2
Joined: 2016-08-04 08:19

Re: disabled suspend targets = high cpu usage

Postby k9us » 2016-08-05 11:30

Nevermind, it's working as intended now. The above configuration seems to be correct. :)
Posts: 2
Joined: 2016-08-04 08:19

Re: disabled suspend targets = high cpu usage

Postby tgp1994 » 2017-10-16 17:26

I just wanted to thank you for your detailed post. I was having the exact same issue, also on a laptop I was using as a server. Whenever the lid was closed, systemd-logind would go nuts just like you saw. For some reason, I didn't even have a logind.conf file. Only one that was moved to a ".bak" extension, which I must have done some time ago. But I wonder why this file was never automatically regenerated, and why removing it seems to cause logind to start consuming massive amounts of CPU.
Posts: 29
Joined: 2009-12-05 02:44

Re: disabled suspend targets = high cpu usage

Postby sammyke007 » 2020-05-06 08:15

I made an account just to say thanks for this! Helped me out a lot!
Posts: 1
Joined: 2020-05-06 08:14

Re: disabled suspend targets = high cpu usage

Postby sunwar » 2020-12-20 13:17

i too made an account just to thank you.
Posts: 1
Joined: 2020-12-20 13:14

Return to System configuration

Who is online

Users browsing this forum: No registered users and 13 guests