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

    Best pratctice CPU allocation for 4 VMs

    Scheduled Pinned Locked Moved Hardware
    13 Posts 4 Posters 1.0k Views 4 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.
    • A Offline
      amine.sahnoun
      last edited by

      Hello,
      For My server wich have 2 CPU "Intel(R) Xeon(R) CPU E5-2620 v3 @ 2.40GHz"
      whats is the best allocation for CPU for each VMs?
      See below print screen of CPU details:
      commande: xl info
      xcp info 01.png
      xcp info 02.png
      commande: lscpu
      lscpu.png
      please advise me to find the right distribution most suited to my CPUs,
      for me I understand that I have in total 2 sockets of which each socket 6 courses of which each core 2 threads, in all 24 threads
      so I gave 5 vCPUs (1 sockets with 5 core per socket)
      with this config I have some 100% CPU crash problems.
      THANKS

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

        I'm not aware of real CPUs with 5 cores per socket. The right distribution is the simplest one, and leaving Xen to schedule your VMs. No need to dig to deep.

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          amine.sahnoun @olivierlambert
          last edited by

          @olivierlambert
          Thanks for your response, what do you suggest? knowing that I have 24 rthreads in total but I thought that 5 vCPUs for 4 VMs makes 20/24 threads so I leave 4 for the host server
          see my choice below
          CPU Allocation.png

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

            1. Stop using XCP-ng Center 😉
            2. Leave the default settings. You don't have to think how much vCPUs to leave, Xen will schedule them. If performance is really capital for you, just try to use less vCPUs total than your physical host got. Don't forget to add the vCPU used by the dom0. But frankly, except if you use ALL your VMs at 100% CPU all the time, it's fine to over commit vCPUs on physical CPUs. IMHO, what you do is probably "premature optimization".
            A 1 Reply Last reply Reply Quote 0
            • A Offline
              amine.sahnoun @olivierlambert
              last edited by

              @olivierlambert
              Thank you but I didn't understand, how do I no longer use xcp center? how will I do this and how will XEN plan the allocation of vCPUs?
              THANKS
              more details please

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

                Reading the doc is a good first step: https://docs.xcp-ng.org/management/ It explains how to manage XCP-ng, especially at scale 🙂

                1 Reply Last reply Reply Quote 0
                • planedropP Offline
                  planedrop Top contributor
                  last edited by

                  Like @olivierlambert mentioned here, you should really be managing things with Xen Orchestra instead of XCP-ng Center, it's a more modern and more feature packed product.

                  As for your CPU allocations, this all is going to come down to workloads, we can't really know unless we know what each VM is going to be doing.

                  But I also think maybe there is a misunderstanding about how CPU allocation works in XCP-ng, it's not like you have 10 cores and 2 VMs so therefore give each VM 5 cores so they each can use half the cores, VM vCPUs are basically like processes in a modern OS, and the scheduler in XCP-ng is going to handle which CPU cores get those vCPU processes (I'm oversimplifying but IMO this is a good way to think about it).

                  So the underlying scheduler will try to balance the vCPUs depending on given workload.

                  A 1 Reply Last reply Reply Quote 1
                  • W Offline
                    wilsonqanda
                    last edited by wilsonqanda

                    Yep Xen Orchestra is really good. Jump to XOA over Xen Center any day. But beside that you can definitely over provision vCPU base on core & threads example:
                    Though it is best to see how much resource each VM takes up and provision it that way otherwise here what I gather:

                    Intel base CPU are using Cores and Threads. Intel Xeon Processor E5-2620 v3, Cores=6; Threads=12

                    (6 Cores x 2 Threads/core) x 2 CPU = 24 vCPUs/4VMs = 6vCPU for each (approx.)
                    

                    Above is only true in some cases as lots of time cpu is the the constraints and ram is. 5 is definitely unusual as i believe it is almost always a even number. not sure if that matter though.

                    A 1 Reply Last reply Reply Quote 0
                    • A Offline
                      amine.sahnoun @planedrop
                      last edited by

                      @planedrop
                      Good morning,
                      Thank you for your answer, while searching I found that xen orshestra is a paid version, do you have an open source version to test it otherwise do you have another solution with xen center in the worst case
                      thank you very much

                      W planedropP 2 Replies Last reply Reply Quote 0
                      • A Offline
                        amine.sahnoun @wilsonqanda
                        last edited by

                        @wilsonqanda
                        Good morning,
                        thank you for your feedback, I found myself obliged to give 5 vCPUs to each VM because I think it is necessary to leave a few vCPUs for the host server (I do not know if this is true) otherwise it would be better to give 6 vCPU for each VM like that I would have 6X4=24 (saturation).
                        but I don't know if it's better to give
                        6 vCPUs (2 sockets with 3 cores per socket)
                        Or
                        6 vCPUs (1 sockets with 6 cores per socket)
                        what do you think ?
                        THANKS

                        1 Reply Last reply Reply Quote 0
                        • W Offline
                          wilsonqanda
                          last edited by wilsonqanda

                          The host server normally should give itself the highest priority I believe so shouldn't matter. But you can assign priority for certain VMs by weight. Higher # means more priority.

                          572859f4-7b2c-453b-964e-ad034fdcd5a6-image.png

                          At the end of the day when you are running all the VMs do you see it fighting for resources if not it shouldn't matter and if it does the hypervisor will take care of it so there is no worry. As there is better chance of it capping the 5 vcpu and not being able to complete its task in time if all workload is not distributed evenly. So i would go with higher.

                          1 Reply Last reply Reply Quote 0
                          • W Offline
                            wilsonqanda @amine.sahnoun
                            last edited by wilsonqanda

                            @amine-sahnoun XO is free but you would have to build it from source which take a bit of work but it is really nice once it is running.

                            1 Reply Last reply Reply Quote 0
                            • planedropP Offline
                              planedrop Top contributor @amine.sahnoun
                              last edited by

                              @amine-sahnoun There is a free version of XOA that you can use, but also the full version of XO can be built from the sources, they have pretty good documentation on how to do so.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post