# How does KVM CPU work?



## Novacha (May 22, 2013)

It was my understanding (at least from looking at some general posts) that on a KVM virtualised system, you can utilize all the CPU allocated to you. Is this true? For instance, on OpenVZ in a standard oversold environment you would not be allowed to usually have a load average of above 1.0. On KVM it could be whatever you wanted, right?

This would make KVM ideal for build and rendering servers, wouldn't it?


----------



## elohkcalb (May 22, 2013)

Hmm... where did you get that idea from?

In general CPU resources are limited and therefore shared by all virtualized containers, by default. So unless the provider specifically mention that it's a dedicated resource, otherwise I'd take it as shared.


----------



## wlanboy (May 22, 2013)

On creating a KVM vps you can allocate virtual CPUs to it.


Each guest CPU (vcpu) corresponds to a QEMU thread.
Because a vcpu is a thread you can apply resource limits to it.
There is an additional parameter "cpuset" allowing you to set which real CPUs should be used for thread creation.


----------



## Novacha (May 22, 2013)

wlanboy said:


> On creating a KVM vps you can allocate virtual CPUs to it.
> 
> 
> Each guest CPU (vcpu) corresponds to a QEMU thread.
> ...


So are you saying that it depends on the provider or is always enabled on default KVM systems?


----------



## wlanboy (May 22, 2013)

Per default KVM uses vcpu.

And yes it always depends on the provider, because it is his/her dedicated server.


----------

