Score:1

libvirtd eating up to 100% CPU with no apparent reason

us flag

Few days ago libvirt has started to behave erratically on my laptop. It consumes a high amount of CPU without any apparent reason. ALL my VMs are shutoff, why is libvirt using up to 100% CPU if no VMs are running?

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                           
 203328 root      20   0 1640992  37056  22308 R  86,1   0,1  22:57.03 libvirtd           
                                          

Killing the process makes my laptop happy. Problem comes back as soon as the process is started again. No idea how to debug or fix this, any help is welcome.

Using up to date Ubuntu 21.10, kernel 5.13.0-30-generic.

Score:0
cn flag

Profile the process to find what exactly is on CPU.

Install debug symbols for libvirt, to get function names.

Watch real time performance counter with perf top --freq=999 --pid==$(pgrep libvirtd) Or perf record to save to file for analysis later. Frequency one off a multiple of ten is to not be locked to things on the second, got this from Gregg.

Analyzing the results of what is on CPU requires some thought. At a high level, what is it doing? How can that be made more efficient? This probably requires talking to OS (Ubuntu) and/or libvirt support channels.

If this is contributes to unacceptable power or thermal demands on your laptop, consider moving the VM to be hosted somewhere else.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.