XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    VM resource usage

    Scheduled Pinned Locked Moved Management
    2 Posts 2 Posters 45 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M Offline
      McHenry
      last edited by

      I have a host with 48 CPUs and 96GB RAM
      f908b4c2-ba10-49ca-97b9-1a3942c62d4e-image.png

      I understand that the RAM cannot be over allocated to VMs or I get the no hosts available message a startup however I understand CPUs can, so I could allocate all VMs 48 CPUs and they will only utilise what they require. Is this correct and if so is there any reason not to allocate the max CPUs to a VM.

      Further to this, if I only allocate the VMs a smaller number of CPUs do they all overlap on the first X CPUs and leave the others unused. i.e. if VM1 has 8 then it will only use the 1st 8 and if VM2 has 4 then it will only use the first 4.

      I ask as I currently have multiple VMs using a lesser number of CPUs than the host has however the status only show the first 15 CPUs in use on the host:
      0e52a47f-8bda-4218-b3f1-6ad93281a9cc-image.png

      1 Reply Last reply Reply Quote 0
      • olivierlambertO Offline
        olivierlambert Vates 🪐 Co-Founder CEO
        last edited by olivierlambert

        Hi,

        A vCPU is scheduled by Xen "like" a process/thread on your operating system is scheduled.

        If a VM got 48x vCPUs, it will be scheduled across all the 48 physical cores. But if other VMs are also using the same vCPU number, the scheduler will have to prioritize, and more work for the scheduler, more wait inside your VMs (because the scheduler will have to give access to a physical core for one VM and then put another one on it, and so on)

        A rule of thumb:

        • Less vCPU than physical cores: no wait possible (more or less the time to schedule, but it's very small)
        • Same number: almost no wait
        • More vCPUs than physical cores: depending on your VM load, you could have more wait. 2:1 or 4:1 ratio are OK for relatively small average load OR non-concurrent load. If all VMs are using all CPUs, as soon as you go beyond physical number of cores, you WILL have an impact on waiting for CPUs.
        1 Reply Last reply Reply Quote 0
        • First post
          Last post