kvm cpu usage

jazzl0ver

Renowned Member
Mar 6, 2013
75
1
73
Hello,

On my proxmox 3.2 box there're several openvz running containers and one running kvm. top shows 17% cpu activity of the kvm, while the kvm itself idling (1% cpu usage, screenshot attached). Does anyone know if it's a correct behavior and what to do if not?

proxmox_cpu_kvm.png

Thanks in advance!

PS Some more information
Code:
# pveversion -v
proxmox-ve-2.6.32: 3.2-121 (running kernel: 2.6.32-27-pve)
pve-manager: 3.2-1 (running version: 3.2-1/1933730b)
pve-kernel-2.6.32-20-pve: 2.6.32-100
pve-kernel-2.6.32-27-pve: 2.6.32-121
pve-kernel-2.6.32-19-pve: 2.6.32-96
pve-kernel-2.6.32-21-pve: 2.6.32-104
pve-kernel-2.6.32-22-pve: 2.6.32-107
pve-kernel-2.6.32-26-pve: 2.6.32-114
lvm2: 2.02.98-pve4
clvm: 2.02.98-pve4
corosync-pve: 1.4.5-1
openais-pve: 1.1.4-3
libqb0: 0.11.1-2
redhat-cluster-pve: 3.2.0-2
resource-agents-pve: 3.9.2-4
fence-agents-pve: 4.0.5-1
pve-cluster: 3.0-12
qemu-server: 3.1-15
pve-firmware: 1.1-2
libpve-common-perl: 3.0-14
libpve-access-control: 3.0-11
libpve-storage-perl: 3.0-19
pve-libspice-server1: 0.12.4-3
vncterm: 1.1-6
vzctl: 4.0-1pve4
vzprocps: 2.0.11-2
vzquota: 3.1-2
pve-qemu-kvm: 1.7-4
ksm-control-daemon: 1.1-1
glusterfs-client: 3.4.2-1

Code:
# cat /etc/pve/qemu-server/108.conf
bootdisk: ide0
cores: 2
ide0: LVM-Storage:108/vm-108-disk-1.qcow2,format=qcow2,size=100G
ide2: none,media=cdrom
memory: 2048
name: vm-w7-dev
net0: virtio=F2:E8:A0:F0:6A:80,bridge=vmbr0
onboot: 1
ostype: win7
sockets: 1
 
As I could see from your screen-shot it´s a Windows 7 guest. I made a similar observation - also in other cases with extensive desktop functions (e.g. linux mint cinnamon ). The emulation of graphic card seems to cost some resources - better results (but still around 5% compared with 0-1% in Windows) ) you get if you use SPICE (verified in PROXMOX 3.2, works fine for Windows 7 guest, no prebuilt binary for Windows 8 available (?)).
 
Thank you, Mr.Holmes. Could you teach me how you detected that this is graphic card emulation issue?
 
Hello jazzl0ver,

I just observed it - therefore I wrote seems to cost some resources; in other word it´s just a guess.

Details about that observation:

- 2 kvm guests with vnc console:
* one windows 7
* one lubuntu (because it has a lightweight desktop)

The CPU percentage values in "top" of PROXMOX server I observed:

- almost complete "idle" state of the guests:
* windows: around 11
* lubuntu: around 1

- intensive mouse movement (and nothing else, in both cases
the task-manager respectively the "top" in guest remains at =< 1%):
* windows: around 14
* lubuntu: around 10

How I concluded:

- Windows is a GUI OS having extensive display features - also in idle state the graphic card (not the - guest - cpu) has "something to do", in case of a kvm it´s emulated and consumes host cpu.

- lubuntu does not have such extensive features, if it is idle also graphic card is idle

- in case of a mouse movement also in lubuntu case graphic activities take place - the difference between lubuntu and windows is less.

Again: just a theory, I am not familiar with graphic HW and corresponding OS implementation.

Best regards

Mr.Holmes