2

So I am noticing my windows KVM guests (managed by proxmox) are showing extremely high CPU usage when doing really simple things like watching a video on youtube. For example a 4 core KVM instance will go up to about 75% CPU usage when watching a single video via Google chrome at 480p. 1080p maxes out the CPU. How is it possible that I cannot watch a 1080p video? Here is my host CPU: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz. I also noticed the host has the following integrated GPU: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a). Here is what I have tried:

  • Different browsers like Opera and Firefox do offer slightly lower CPU numbers but again too high to be acceptable.
  • Enabling and disabling hardware acceleration in Google Chrome settings does nothing.
  • Setting CPU type to host does not help
  • Setting Display to VirtIO-GPU does nothing
  • Setting Display to SPICE and installing spice-guest-tools does nothing

Any help would be so greatly appreciated!

ktb92677
  • 121
  • 1
  • 3

2 Answers2

4

From my experience, Windows guests usually munch too much CPU when a virtual hardware driver is set to something less than ideal.

The settings I usually make are:

  • Storage should always be VirtIO-SCSI. You can just change this setting for an existing VM if the VirtIO-SCSI driver is already installed in the guest, but installing new guests requires you also have the VirtIO-Win ISO mounted during installation so you can load the driver.
  • I set the CPU to match the code name of the underlying processor. For an E5-2697 V2 this means using IvyBridge-IBRS rather than kvm64 or host. (IBRS activates certain Spectre/Meltdown mitigations.) I use "host" only when nested virtualization is required, i.e. running Hyper-V inside the Windows guest, because nested Hyper-V actually requires it.
  • Sockets are set to 1 and Cores set to the number of virtual CPUs desired.
  • Display should be set to SPICE. No other setting will allow for smooth video playback, so there's no point changing it.
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
2

Found in https://www.reddit.com/r/VFIO/comments/80p1q7/high_kvmqemu_cpu_utilization_when_windows_10/ ...

?sudo? virsh edit vm-name

    <clock offset='localtime'>
-    <timer name='rtc' tickpolicy='catchup'/>
-    <timer name='pit' tickpolicy='delay'/>
-    <timer name='hpet' present='no'/>
+    <timer name='hpet' present='yes'/>
     <timer name='hypervclock' present='yes'/>
   </clock>

In my case it reduces the CPU usage from 20%-30% to 3%-5% per Windows guest (KVM-processes serving that).

sebres
  • 1,100
  • 1
  • 5
  • 6