Best pratctice CPU allocation for 4 VMs
-
- Stop using XCP-ng Center
- 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".
-
@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 -
Reading the doc is a good first step: https://docs.xcp-ng.org/management/ It explains how to manage XCP-ng, especially at scale
-
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.
-
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.
-
@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 -
@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 -
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.
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.
-
@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.
-
@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.