How does KVM CPU work?

Discussion in 'Questions and Answers' started by Novacha, May 22, 2013.

Tags:
  1. Novacha

    Novacha Content Contributer

    135
    63
    May 15, 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?
     
  2. elohkcalb

    elohkcalb New Member

    18
    1
    May 16, 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.
     
  3. wlanboy

    wlanboy Content Contributer

    2,126
    1,169
    May 16, 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.
     
  4. Novacha

    Novacha Content Contributer

    135
    63
    May 15, 2013
    So are you saying that it depends on the provider or is always enabled on default KVM systems? 
     
  5. wlanboy

    wlanboy Content Contributer

    2,126
    1,169
    May 16, 2013
    Per default KVM uses vcpu.

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