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

    VM vCPU allocation

    Scheduled Pinned Locked Moved Management
    8 Posts 3 Posters 560 Views 2 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 McHenry

      If a host has 8 CPUs:

      If running one VM will there be a difference in performance between allocating to the VM:

      1. 2 vCPUs
      2. 8 vCPUs

      If running two VMs will there be a difference in performance between allocating to each VM:

      1. 2 vCPUs
      2. 4 vCPUs
      3. 8 vCPUs

      Edit: Windows Server VMs

      A 1 Reply Last reply Reply Quote 0
      • A Offline
        Andrew Top contributor @McHenry
        last edited by

        @McHenry You can allocate more vCPUs than real CPUs. If a VM is single threaded bound then adding more vCPUs won't make it faster and also won't slow down other VMs. If you allocate more vCPUs and they are all busy then all VMs will slow down because they share CPU cores.

        Unless you do something special then VMs allocated vCPUs that don't use them won't really interfere with other VMs that need CPU time that share vCPUs.

        Remember Dom0 also has vCPUs allocated and will share time with VMs.

        M 2 Replies Last reply Reply Quote 1
        • M Offline
          McHenry @Andrew
          last edited by

          @Andrew

          So if a VM will only ever use the CPU resources it requires, regardless of what is allocated to it. What is the case to ever allocate less than the maximum number of vCPUs available?

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jr-m4 @McHenry
            last edited by

            @McHenry
            Differences could be things such as:

            • Amount of cores between hosts for migrations
            • Guarantee performance between guests. So that they don't affect each other as much.

            Same with overprovisioning dynamic RAM

            1 Reply Last reply Reply Quote 1
            • M Offline
              McHenry @Andrew
              last edited by McHenry

              @Andrew

              What about topology?
              683c2044-ee87-44eb-aa1b-24272b2f9cbb-image.png

              • 1 X 8
              • 2 X 4
              • 4 X 2
              • 8 X 1

              6da5ee84-2f1b-49f9-ab75-29076c0c04ba-image.png
              https://learn.microsoft.com/en-us/sql/sql-server/compute-capacity-limits-by-edition-of-sql-server?view=sql-server-2016

              I understand this to mean:

              • With SQL Server Express 1 X 8 would be optimal
              • With SQL Server Standard 4 X 2 would be optimal

              Does that sound right?

              A 1 Reply Last reply Reply Quote 0
              • A Offline
                Andrew Top contributor @McHenry
                last edited by

                @McHenry Minimal effect on having more sockets but less cores. Keep it simple.

                If your license limits you to 1 socket and 4 cores, then 1 socket and 4 cores is what you use. 1 socket an 8 cores is greater than the 4 core limit.

                For the 4 socket/24 core limit you could still use 1 socket and 24 cores (or 1 socket and 8 cores, or 2 sockets and 12 cores each, or 4 sockets and 6 cores each). But you can't use 6 sockets and 4 cores each because that's over the limit.

                The math has to work out to support your system. You can't have 4 sockets and 4 cores if you only have 8 cores in your system (or threads, but then you have to look at the SMT notes about hyperthreading).

                You can have more VMs with allocated cores than your system actually has (like 4 VMs with 4 cores each, on an 8 core host), but a single VM can't have more cores allocated then the host actually has (like 16 cores in a VM on an 8 core host).

                I think the optimal assignment is to use the template default or the number of sockets your host has (or less) and then assign the number of cores you need. There's a whole NUMA issue that Xen tries to work out between the host and the guest. If you go into SQL optimization then you might want to pin CPUs for the VMs for best performance. If you have a single socket system then just use one socket and the number of cores you want. If you have a pool then watch out for the minimum system specs (ie. you can't migrate a 16 core VM from a 24 core host to an 8 core host).

                M 1 Reply Last reply Reply Quote 1
                • M Offline
                  McHenry @Andrew
                  last edited by McHenry

                  @Andrew

                  Sorry, 100% confused now 🙂

                  In a virtualized environment, the compute capacity limit is based on the number of logical processors, not cores. The reason is that the processor architecture isn't visible to the guest applications.
                  https://learn.microsoft.com/en-us/sql/sql-server/compute-capacity-limits-by-edition-of-sql-server?view=sql-server-2016

                  As I am using a Windows VM, does this mean I need to base my calculations on logical processors?

                  A logical processor is the number of the processor's cores multiplied by the number of threads per core.
                  https://www.intel.com/content/www/us/en/support/articles/000036898/processors/intel-xeon-processors.html

                  Xen Orchestra shows my CPU as having 15 cores whereas the Intel website shows my CPU as having 8 cores and 16 threads.

                  22e6d616-b5de-414e-887f-e2831655ed4a-image.png

                  b53bd13b-45ea-4af2-9932-f93dcd573259-image.png
                  https://ark.intel.com/content/www/us/en/ark/products/193389/intel-xeon-silver-4215-processor-11m-cache-2-50-ghz.html

                  Would I be correct in concluding that the number or cores in XO equates to the number of logical processors? So the combination of sockets and cores on the VM does not matter as long as the total does not exceed the number of cores listed in the Microsoft website?

                  A 1 Reply Last reply Reply Quote 0
                  • A Offline
                    Andrew Top contributor @McHenry
                    last edited by

                    @McHenry Yes, XCP sees and uses all threads (8 core + SMT x2 threads = 16 logical cores). So you can assign all of them to a VM as long as the VM can use them.

                    XO shows 16 "cores" (total threads) and 1 socket. It also shows hyperthreading is enabled. XCP/XO does not differentiate between cores, threads, E-Cores or P-Cores.....a thread is an assignable core resource.

                    You can assign 16 logical vCPU that includes real cores and SMT threads.

                    Some programs do not work well with hyperthreading in a VM environment. So you may wish to disable SMT depending on the workload.

                    1 Reply Last reply Reply Quote 2
                    • G Greg_E referenced this topic on
                    • First post
                      Last post