Windows 2012 idle CPU usage

pietrek

New Member
May 31, 2013
27
1
3
Hello,

We've recently installed a Windows 2012 R2 as a guest OS on our dual E5-2620 Proxmox 3.3-1/a06c9f73 based host. It's in the process of testing and tweaking and what we're trying to do now is reduce its idle CPU usage. We've already switched to virtio-blk and vitio-net drivers, added the T8038 flag to our SQL 2008 instance, switched to useplatformclock in bcdedit and removed the tablet USB device, plus switched machine type to q35 (for better USB passthrough suport).

Here's the machine's config file:

boot: cdn
bootdisk: virtio0
cores: 4
cpu: host
ide2: NFS_STORAGE:iso/IRM_SSS_X64FRE_PL-PL_DV5.ISO,media=cdrom
machine: q35
memory: 48000
name: W2012
net0: virtio=A6:3D:38:55:AB:E0,bridge=vmbr0
onboot: 1
ostype: win8
scsihw: virtio-scsi-pci
smbios1: uuid=07010a76-8eb0-4188-a2c7-fadd195a8b0a
sockets: 1
tablet: 0
vga: std
virtio0: NFS_STORAGE:100/vm-100-disk-1.qcow2,format=qcow2,cache=writeback,size=32G
virtio1: NFS_MSSQL:100/vm-100-disk-1.qcow2,format=qcow2,cache=writeback,backup=no,size=320G

Windows Task Manager shows around 1-2% CPU at idle, while at the same time host's top oscilates at about 10-11% for kvm process.

Is there any way to bring it down even further? Is it actually doable and worth the struggle, or is this all we can get?
 
or is this all we can get?
Try to disable balloon driver

balloon:0


also,

One missing feature from last qemu version, is hyper-v timer.

Not sure sure it's working with 2.6.32 kernel, but it should work with 3.10 kernel.

to test it, you can try to launch kvm process manually

do a #ps -aux ,
copy your vm kvm process line (kvm -i vmid .....)

and change the argument:

-cpu ....,hv_relaxed......

to

-cpu ....,hv_relaxed......,hv_time


stop the vm

and launch it with pasting the modified kvm command line.
 
Thanks for you swift reply. We're not using memory ballooning on this VM and the PCI device itself has been disabled. Adding hv_time doesn't seem to work with current kernel (doesn't make any difference) and we'd rather stay away from 3.10 since it is not officialy supported yet. Any other tips?
 
Last edited:
We've already enabled that flag.
Our current dstat int/csw results are:

---system--
int csw
1228 9229
368 1684
407 1724
365 1727
402 1732
734 1976
1144 3065
392 1732
892 2789
672 1773
1514 3646
405 1924
376 1719
415 1776
442 1935
494 1857
1071 3099
544 1956

Which I'd say feels pretty decent. Guess we'll stick with what we've got. Our workload isn't that much CPU taxing after all and that's the overhead we can live with. Things will probably improve once 3.10 kernel becomes official and more qemu pudates follow. BTW, it'd be nice to be able to to specify additional kvm flags through either config file or via the web interface instead of having to restart the entire process maually. Is such a feature planned?
 
You mean by adding this in vm.conf?


args: string

Note: this option is for experts only. It allows you to pass arbitrary arguments to kvm, for example:
args: -no-reboot -no-hpet
 
I guess yes. If that'd that let me add for example hv_time to -cpu switch. Would it?
 
I guess so, you have to try out :)
I usually give all persistent kvm related parameters there.
 
Hmmm... That CPU usage seems really weird. I'm copying a database from our main SQL server to that Windows 2012 guest and right now Windows' task manager shows ~8% CPU being used, while host's CPU usage from top floats around 30% but dstat gives me this:

----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read writ| recv send| in out | int csw
1 0 98 0 0 0| 11k 23k| 0 0 | 16B 46B|1296 8480
1 0 98 0 0 0|8192B 512B| 89k 72k| 0 0 |1015 2824
1 0 98 0 0 0|8192B 512B| 154k 146k| 0 0 | 991 2827
3 1 97 0 0 0|8192B 3584B| 130k 121k| 0 0 |1521 3069
2 1 97 0 0 0|8192B 49k| 160k 150k| 0 0 |1528 4883
1 0 98 0 0 0|8192B 512B| 83k 177k| 0 0 | 863 3240
2 0 98 0 0 0|8192B 512B| 161k 147k| 0 0 |1069 3175
1 0 98 0 0 0|8192B 512B| 127k 120k| 0 0 | 882 2683
1 0 98 0 0 0|8192B 512B| 155k 148k| 0 0 | 984 2858
2 1 98 0 0 0|8192B 99k| 121k 116k| 0 0 |1832 4246
2 0 98 0 0 0|8192B 4608B| 162k 172k| 0 0 |1152 3234

is top misinterpreting something?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!