Limiting a KVM (Windows) or Virtual Machine CPU resources

Giovanni

Renowned Member
Apr 1, 2009
110
11
83
Hello guys

I was able to setup Windows Server 2003 without a hitch on my Q6600 Core2.

I am able to assign it RAM / Disk space so I know it won't go over that.

Now, I installed Prime95 an utility used by Overclockers to do iterations and max out memory/cpu to proof test the ability to handle the load of the VM.

When I created the VM, the settings where:

CPUs = 1
CPU Units = 1000
Fine, so I load Prime95 and keep the VM at full load and the server load goes to 100% use (when you hit "Home" to see the server as a whole).

I lower the number CPU units to 100, no change, 50 now we get 25% top usage on the server as a whole.

I changed 50 to 25 now and I can't get the server (as a whole) load to go below 25% CPU load while the VM is at 100% CPU... help please
 

Attachments

  • Capture.jpg
    Capture.jpg
    104.2 KB · Views: 72
Last edited:
you got 4 cpus on the host.

and 1 cpu on the guest: this is 25 % of the host cpu.
 
you got 4 cpus on the host.

and 1 cpu on the guest: this is 25 % of the host cpu.

Understood, however I want to limit that single CPU I gave the Guest OS.

Possible? I thought thats what CPU units where for. What are CPU Units?
 
Understood, however I want to limit that single CPU I gave the Guest OS.

Possible? I thought thats what CPU units where for. What are CPU Units?

As i know CPU units its for reserve 'minimum' CPU resources for VM. VM can use all CPU resources, but it can by limited when another VM is actyve too.
 
As i know CPU units its for reserve 'minimum' CPU resources for VM. VM can use all CPU resources, but it can by limited when another VM is actyve too.

Thanks.

I am trying this theory out, but so far my CPU load is 100% (for this Quad core).

Keep in mind all settings are CPUS = 1 on all 4 VMs. See attached
 

Attachments

  • Capture.JPG
    Capture.JPG
    62.8 KB · Views: 84
Interesting, all 4 VMs are doing the same thing and it seems like KVM pairs them up to "share" memory? (I still have a little of SWAP usage)
 

Attachments

  • Capture.JPG
    Capture.JPG
    43.4 KB · Views: 49
Interesting, all 4 VMs are doing the same thing and it seems like KVM pairs them up to "share" memory? (I still have a little of SWAP usage)

the memory shown for windows guest is not really perfect. for Linux guest its better but also not perfect. maybe you should jump into the KVM mailing list, there is a discussion about improving this (KSM).
 
Is it possible to limit how many Mhz we give to a VM/KVM? I believe its possible since HyperVM seems to do it they use OpenVZ
 
I was possible with older openvz kernels (<= 2.6.18). But the OpenVZ team did not implement this with newer kernels.
 
I was possible with older openvz kernels (<= 2.6.18). But the OpenVZ team did not implement this with newer kernels.

Hmm, I will research this further. Can you please point me in the direction where proxmox VE saves the "init" values for KVM/OpenVZ virtual machines?

Let's say I saw a line to start the VE in the OpenVZ forums and it seems to work, is there any way to hard-code it into Proxmox so every time I start (just that one VE) it will use say "cpulimit=512"?

Same goes for KVM I know its a different environment so it may have two answers for the two case scenarios.

Thanks
 
OpenVZ config:

directory: /etc/vz/conf/
docu: "man vzctl"

KVM config:

directory: /etc/qemu-server
docu: "man qm"
 

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!