1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

CPU questions

Discussion in 'Proxmox VE 1.x: Installation and configuration' started by gkovacs, Dec 24, 2008.

  1. gkovacs

    gkovacs Member

    Joined:
    Dec 22, 2008
    Messages:
    463
    Likes Received:
    22
    I have a couple of questions regarding CPU allocation between VEs.

    1. What does the CPU Units value mean for OpenVZ (and is it different for KVM)?

    2. Do the KVM and VZ CPUUnits values respect each other across, or are completely independent?

    3. I noticed there is a --cpus 1 argument when creating an OpenVZ VE. Exactly what does it do? Does it mean that one particular VE can use only one CPU core? (If I view /proc/cpuinfo in the VE it shows all four cores of my CPU).

    Merry Christmas and a Happy New Year to the Proxmox team and all fellow users!
     
  2. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,030
    Likes Received:
    142
    CPU weight for a container. Argument is positive non-zero number,
    passed to and used in the kernel fair scheduler. The larger the
    number is, the more CPU time this container gets. Maximum value is
    500000, minimal is 8. Number is relative to weights of all the
    other running containers. If cpuunits are not specified, default
    value of 1000 is used.


    Same meaning for OpenVZ and KVM.

    They respect each other (kernel fair scheduler settings).

    Unfortunately --cpus does not work for OpenVZ currently. We still wait until it gets implemented by the OpenVZ team (for kernel 2.6.24). So containers always use all available CPUs at the moment.

    - Dietmar
     
  3. Giovanni

    Giovanni Member

    Joined:
    Apr 1, 2009
    Messages:
    43
    Likes Received:
    0
    Hi,

    I was just searching for the answers to my question and I found this thread. Hopefully you don't mind me bumping it.

    So CPU Units is just a value that is taken into consideration when having multiple VMs? So say I have 5 VMs using CPUs =1 core, and different CPU Units values:

    VM 1 = 8
    VM 2 = 100
    VM 3 = 500
    VM 4 = 1000
    VM 5 = 3000

    If all of them are running 100% of the CPU, will it in reality "throttle" the other VMs in any way to avoid the host itself (proxmox) overloading? Given that its a QUAD core and I assigned only 1 core to all those machines load should never go above 25% right? (assuming 1 core 100% CPU use)
     
  4. hisaltesse

    hisaltesse Member

    Joined:
    Mar 4, 2009
    Messages:
    203
    Likes Received:
    0
    I would actually like to bring a small correction here with respect to CPU Units on OpenVZ:

    1. CPU Units of 1000 does not mean that you get 1/10th of the cpu time for the particular vm

    2. The maximum units is not 500000

    CORRECTION:
    According to the OpenVZ manual: CPU units are the number of CPU time you guaranty to a VM.

    You first need to find out how many CPU units you have in your system by running:

    Code:
    vzcpucheck
    In my case I get:

    Code:
    vzcpucheck
    Current CPU utilization: 14000
    Power of the node: 906755
    Now if I give 1000 units to a VM on this node, it means that this OpenVZ VM is getting 1000 divided by 906755 and multiplied by 100 = 0.1% of the CPU time.

    So if I want to give 5 percent of guaranteed time to my VPS, I would enter CPU Units = 45337

    ---
    I hope this clarifies things.
     
  5. vcp_ai

    vcp_ai Member

    Joined:
    Jul 28, 2010
    Messages:
    170
    Likes Received:
    0
    Can you tell me if exists an equivalent to vzcpucheck for KVM (I'm using Proxmox 1.5 with no Openvz support)
     
  6. dietmar

    dietmar Proxmox Staff Member
    Staff Member

    Joined:
    Apr 28, 2005
    Messages:
    15,030
    Likes Received:
    142
    You have one process per KVM VM - so i guess you can use 'ps'
     

Share This Page