Configure ESX VMs to Use Hyper-Threading Effectively

affinitycentral-processing-unithyperthreadingvmware-esx

I've a kind of specific question that I was unable to find an answer for in the official documentation of VMware or on some other very useful threads here on this platform, so here it is:

I've got a host using ESX 6.0 with 2 sockets, each has 6 cores with HT. So in total I'm having 12 cores and 24 Threads on that Hardware.

It is running 10 VM's. I've allocated 34 cores (I know thats bad, but can't change that right now).
However, I'm experiencing serious problems with 1 of the VMs, that has 8 cores assigned (2 x 4).

I'm aware of how hyper threading is working and that in an ideal workload an HT-Core would have around 50% of the performance of an "real" core.

So here is my question: Would I benefit from using CPU affinity to make sure, that this Server has 8 "real" (=faster) cores, instead of letting VMware handle cores?

Best Answer

Your problem is not HT. 50% HT boost is a number based on nothing. Usually, it can be 5-20% boost to some multi-threaded applications depending on the code and the workload. The point is you should not count on this when allocating cores.

In the case of VMWare, CPUs are considered the real cores and logical processors are considered the HT part.

Example:

Intel(R) Xeon(R) CPU E5-2620 v4 has 8 cores and 16 threads. A Dell server using a dual socket configuration will have 2 of these processors, meaning 16 cores and 32 logical processors (aka threads). So the ESXi host will show: 16 CPUs x Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz

This is exactly what is happening in your case: you have 2 CPUs with 6 cores each, meaning ESXi will have 12 cores to use (and 24 logical processors).

Problems in your case: 34 cores is significantly more than 12 and even more than 24. This is only fine as long as you don't have multiple guests using their allocated CPUs to the maximum.

Assigning 2 cores and 4 sockets is not good, as you have 2 sockets. ESXi can handle the translations but it's better for you to assign 4 CPU cores and 2 sockets. If you really need processing power on that 8-core guest, then you should use the reservation option when allocating the CPUs. That will make sure the other guests will not steal CPU power from your CPU-intensive guest.

Related Topic