VMware Cloud Community
soda9191
Contributor
Contributor
Jump to solution

ESXi cores and virtual machine CPU

The question that I would like to pose is ESXi CPU cores and virtual machine CPU relationship. Is there a best practice to assigning cores to VM (This is assuming the VM needs extra CPU do to performance reasons)? Let's use the following example. If the ESXi host that the VM resides has 40 CPU cores is it best practice to assign cores in the 2, 4, 8 format to the VM? And is it okay to assign 6 since 40 is not divisible by 6.

Tags (3)
Reply
0 Kudos
1 Solution

Accepted Solutions
sparrowangelste
Virtuoso
Virtuoso
Jump to solution

jrmunday: when it comes to cores vs sockets, they are only there for licensing purpioses, other then that a vcpu is a vcpu

soda: each core is a vcpu, so you shouldn't be worrying about the underlying hardware and divisibbility.. there isnt a mathematical formula to be used based on underlying archatecture. the only reason underlying archatecutre would matter is EVC differences, not core differences.

--------------------- Sparrowangelstechnology : Vmware lover http://sparrowangelstechnology.blogspot.com

View solution in original post

Reply
0 Kudos
10 Replies
sparrowangelste
Virtuoso
Virtuoso
Jump to solution

vms are independent of the physical hardware due to the hypervisor.

so you can asign 3,4,5 cores.

that said, its best practice to assign less cores then increase because of overhead, and too many vcpus if not needed can slow down a vm.

--------------------- Sparrowangelstechnology : Vmware lover http://sparrowangelstechnology.blogspot.com
Reply
0 Kudos
jrmunday
Commander
Commander
Jump to solution

Obviously the more SMP you introduce, the more chance you have of degrading performance so it's a case of assigning based on actual requirements and no more. One key requirement for performance though is to check you NUMA node size and make sure that you keep VM's within the NUMA boundaries.

There is however one related question that keeps me thinking ... Other than potentially licencing, what impact does it make if you swap the sockets for processors or visa versa?

So as an example, I have 4 cores in my VM. What difference does it make if they are configured as;

1 socket with 4 cores;

1_4.png

or 4 sockets with 1 core;

4_1.png

In both examples, you have 4 our cores - so what is the school of thought chosing one or the other?

I guess it would depend on wether the application was multithread aware, etc. but from a VMware perspective what is best and why?

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
Reply
0 Kudos
soda9191
Contributor
Contributor
Jump to solution

I understand the implications of assigning CPUs to a VM that are not going to be used. But the question that I would like to have have answered is about assigning the VM the correct CPU according to the host. If the VM is showing high CPU and I have the choice of assigning 7 vs 8 CPU. What are the implications if the host has 40 CPU cores? Should I assign 8 (if the VM will use them all) instead of the 7 since 40 is divisible by 8? Is there a mathematical formal that needs to be used?

Reply
0 Kudos
sparrowangelste
Virtuoso
Virtuoso
Jump to solution

jrmunday: when it comes to cores vs sockets, they are only there for licensing purpioses, other then that a vcpu is a vcpu

soda: each core is a vcpu, so you shouldn't be worrying about the underlying hardware and divisibbility.. there isnt a mathematical formula to be used based on underlying archatecture. the only reason underlying archatecutre would matter is EVC differences, not core differences.

--------------------- Sparrowangelstechnology : Vmware lover http://sparrowangelstechnology.blogspot.com
Reply
0 Kudos
jrmunday
Commander
Commander
Jump to solution

Here is a recent white paper with some interesting information;

http://www.vkernel.com/files/docs/white-papers/vcpu-sizing-considerations.pdf

It basically says that you should add additional vCPU's one at a time and constantly monitor utilisation & performance. I know that is just doesn't feel right having an odd number of vCPU's but depending of your consolidation ratio you will probably get better performance from a VM with 7 vCPU's in than 8vCPU's.

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
jrmunday
Commander
Commander
Jump to solution

Cool, thanks.

vExpert 2014 - 2022 | VCP6-DCV | http://www.jonmunday.net | @JonMunday77
Reply
0 Kudos
peetz
Leadership
Leadership
Jump to solution

By choosing different combinations of sockets/cores numbers you influence the virtual NUMA setup of the VM.

Most moderm Guest OSs are able to benefit from NUMA when running certain workloads. Read more about (virtual) NUMA here:

http://pubs.vmware.com/vsphere-51/topic/com.vmware.vsphere.resmgmt.doc/GUID-17B629DE-75DF-4C23-B831-...

- Andreas

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
soda9191
Contributor
Contributor
Jump to solution

Can you please comment on this KB article. KB 1010184

Please explain if this does or does not apply to the orginal post.

Notes: Ensure that the number of vCPUs is divisible by the number of cpuid.coresPerSocket in the virtual machine. That is, when you divide the number of vCPUs by the number of cpuid.coresPerSocket , it must return an integer value. For example, if your virtual machine is created with 8 vCPUs, coresPerSocket can only be 1, 2, 4, or 8.

Reply
0 Kudos
chriswahl
Virtuoso
Virtuoso
Jump to solution

Please explain if this does or does not apply to the orginal post.

Notes: Ensure that the number of vCPUs is divisible by the number of cpuid.coresPerSocket in the virtual machine. That is, when you divide the number of vCPUs by the number of cpuid.coresPerSocket , it must return an integer value. For example, if your virtual machine is created with 8 vCPUs, coresPerSocket can only be 1, 2, 4, or 8.

The logic still holds true, but the options are defined by the GUI in vSphere 5 and does not require using the advanced configuration value. In the example above, 1, 2, 4, and 8 are the only multipliers possible on a 4 socket box to achieve an 8 vCPU machine (as shown in the table in that KB).

The drop down list for virtual sockets and cores per socket will only present realistically possible options.

VCDX #104 (DCV, NV) ஃ WahlNetwork.com ஃ @ChrisWahl ஃ Author, Networking for VMware Administrators
Reply
0 Kudos
soda9191
Contributor
Contributor
Jump to solution

So if the server has 40 logical processes and I assign 6 cores to the VM will it have a performace degradation vs if the server had 42 logical cores( 6 divides into 42 evenly)? Or should I choose mulitple like 2,4,8....

I can select 2 virtual sockets and 3 cores per socket=6 along with 3 sockets and 2 cores per socket. My question is strictly coming from a performace stand point.

Reply
0 Kudos