Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

disabled suspend targets = high cpu usage

Linux Kernel, Network, and Services configuration.
Locked
Message
Author
k9us
Posts: 2
Joined: 2016-08-04 08:19

disabled suspend targets = high cpu usage

#1 Post by k9us »

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

HandlePowerKey=poweroff
HandleLidSwitch=ignore
IdleAction=ignore
IdleActionSec=30min
... 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
8.5

$ hostnamectl
Icon name: computer-laptop
Chassis: laptop
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 3.16.0-4-686-pae
Architecture: x86

k9us
Posts: 2
Joined: 2016-08-04 08:19

Re: disabled suspend targets = high cpu usage

#2 Post by k9us »

Nevermind, it's working as intended now. The above configuration seems to be correct. :)

tgp1994
Posts: 29
Joined: 2009-12-05 02:44

Re: disabled suspend targets = high cpu usage

#3 Post by tgp1994 »

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.

sammyke007
Posts: 1
Joined: 2020-05-06 08:14

Re: disabled suspend targets = high cpu usage

#4 Post by sammyke007 »

I made an account just to say thanks for this! Helped me out a lot!

sunwar
Posts: 1
Joined: 2020-12-20 13:14

Re: disabled suspend targets = high cpu usage

#5 Post by sunwar »

i too made an account just to thank you.

User avatar
korilius
Posts: 422
Joined: 2012-04-10 00:53
Location: US/IN
Has thanked: 3 times

Re: disabled suspend targets = high cpu usage

#6 Post by korilius »

Kudos! This worked like a champ.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: disabled suspend targets = high cpu usage

#7 Post by Head_on_a_Stick »

Closing this thread to prevent further pointless necrobumping. Sleep tight thread...
deadbang

Locked