CPU usage of KVM

cpukvmperformancevirtualization

I have a linux host with 4 KVM linux guests. All the guest are pretty much idle, having a load of <0.1 inside the guest.

Now, if I do a top on the host, each KVM process is using something about 30% of the CPU.

Is this a normal behavior? I would expect the host to need much less CPU just to host a idle guest.

If it is normal, what is the reason for this?

If it is not normal, what might be the problem?

Best Answer

Being cynical I could say that is "normal" for Windows guests but not for Linux guests (at least I never saw one behave like that).

With Windows it depends a lot on the applications running (near idle). A plain XP or W2K (I have no experience with newer versions in KVM yet) causes 10% to 20% on the host (being shown about 0% within) but MS SQL server gets this easily above 30%. This seems to be related to timer access and / or ACPI somehow. But even in a non-ACPI VM I never got Windows below 10% on the host.

Edit 1 (integrating comments)

What is the output of cat /sys/devices/system/clocksource/clocksource0/current_clocksource (in the guest)? That should be kvm-clock. Check your kernel config (/proc/config.gz) for CONFIG_PARAVIRT_CLOCK and CONFIG_KVM_CLOCK.

This is a list of kernel config options relevant to KVM.

Related Question