How can I figure out what polkitd is doing with so much of my system's resources?

I had the same problem with high CPU usage after closing the lid on my Acer C710 Chromebook running chrUbuntu 13.04. On my system, dbus-monitor --system shows a swarm of NameOwnerChanged messages, about 30 per second. These repeatedly wake up everybody on the dbus, particularly polkitd, but also network manager, nm-applet, etc.

But DBus is only doing this because acpid keeps repeatedly running the /etc/acpid/lid.sh script. This, in turn, is due to an overactive ACPI interrupt line, exactly the same problem as on this question:

Why does kworker cpu usage get so high?

For my system, the problem was in /sys/firmware/acpi/interrupts/gpe1F, and echoing "disable" to this interrupt immediately stopped the CPU usage. This results in a system that does exactly nothing when the lid is closed, but I can still "sudo pm-suspend" from the console, and opening the lid or pressing a keyboard wakes normally.

And more importantly, CPU usage is down to nearly zero!


I've had the same symptom, in my case it was Nepomuk drowning dbus in a flood of activity. I imagine there are a million ways to create that same symptom, though.

dbus-monitor was a great place to start. Did you try dbus-monitor --system as well as dbus-monitor --session ?

You might snoop on those other high-CPU consumers with strace, see what they're opening/closing/sending.

Easy way to open strace for a process by name:

sudo strace -p$(ps -ef |grep console-kit-daemon |grep -v grep |awk '{print $2}') 

Pulled from: https://askubuntu.com/a/233947

I can't comment on another answer, but from the highest rated answer, it says to echo "disabled" into an interrupt in order to disable an overactive ACPI line. To find which interrupt, run this:

grep . -r /sys/firmware/acpi/interrupts/

Then, look for the answer with the high number. Echo disable into that file and you should be good to go.

The source link at the top has full info on how to make it persistent after suspend and reboot, but click his answer, I don't deserve any credit for that.