VMware Cloud Community
xSequentialx
Contributor
Contributor
Jump to solution

Correct allocation of CPU resources to VM with hyperthreading VCPU ESXI 5.5

HI,

I have been reading various articles about trying to size the CPU allocation for VMs and performance issues with overcommitting but still can't seem to find a definitive answer with hyper threading involved for this particular setup and was hoping someone could clarify it for me.

Example 1 - Exchange 2010 Server

1 x 6 Core Processor (12 logical with hyper threading)

Currently this has 1 socket and 6 cores assigned to it out of a possible 12.

There is only 1 virtual machine running on the server. Would I benefit from increasing the number of cores from either of the following:

1 socket, 12 cores

6 sockets, 1 core

12 sockets, 1 core

any other configuration?

Example 2 - Server has 2 x 6 Core Processors with Hyper threading enabled. (12 Cores, 24 Logical)

I want to assign 2 physical cores to VM1, 4 physical cores to VM2 and 6 physical cores to VM3

Which would I do out of the following:

VM1 - 1 socket, 2 cores     VM2 - 1 socket, 4 cores     VM3 - 1 socket 6 cores

VM1 - 1 socket, 4 cores     VM2 - 1 socket, 8 cores     VM3 - 1 socket 12 cores

VM1 - 2 sockets, 1 core     VM2 - 2 sockets, 4 cores     VM3 2 sockets, 6 cores

VM1 - 2 sockets, 2 cores     VM2 - 2 sockets, 8 cores     VM3 - 2 sockets, 12 cores

VM1 - 2 sockets, 1 core     VM2 - 4 sockets, 1 core     VM3 - 6 sockets, 1 core

VM1 - 4 sockets, 1 core     VM2 - 8 sockets, 1 core     VM3 - 12 sockets, 1 core

any other configuration?

0 Kudos
1 Solution

Accepted Solutions
NuggetGTR
VMware Employee
VMware Employee
Jump to solution

No you can allocate more vCPU than you have. what you have stated there is fine. I usually go for a 6 to 1 ratio. for example with 12 cores we could have up to 72 vCPUS (this is all relative to workload type and VM size through)

I was saying you never allocate a single VM more than the physical cores as the guest OS on the VM thinks it has full cores to play with not hyper threaded cores..

But hyper threading can give use better ability to over commit the CPU resources as it intelligently uses the additional threads when performance will not be impacted. as long as all those VMs are not going to be running at 100% then you could add a number more with no real impact. If those 3 VMs you have listed were to use 100% each you would be using 100% of the host CPU not 50%. never use logical cores when it comes to capacity calculations only physical cores

Cheers

________________________________________ Blog: http://virtualiseme.net.au VCDX #201 Author of Mastering vRealize Operations Manager

View solution in original post

0 Kudos
6 Replies
a_p_
Leadership
Leadership
Jump to solution

Welcome to the Community,

it basically doesn't matter whether you assign 1 vCPU with multiple vCores, multiple vCPUs with a single core, or anything between. However, there might be a difference (in high performance environments) with when you assign a high number of virtual CPUs/cores regarding NUMA. I'd suggest you take a look at e.g. http://www.vmware.com/files/pdf/techpaper/VMware-vSphere-CPU-Sched-Perf.pdf for details. For Example 1 you may certainly assign more vCPUs/vCores to the VM if it is the only one on the host, but you may not really benefit from this if the Exchange VM doesn't require the additional resources.

André

0 Kudos
vfk
Expert
Expert
Jump to solution

This only time it would make sense to use higher number of cores is, if you have Windows Server Standard because you cannot assign more than four sockets.  Other than that, let the CPU scheduler is smart enough to manage allocation.

--- If you found this or any other answer helpful, please consider the use of the Helpful or Correct buttons to award points. vfk Systems Manager / Technical Architect VCP5-DCV, VCAP5-DCA, vExpert, ITILv3, CCNA, MCP
0 Kudos
xSequentialx
Contributor
Contributor
Jump to solution

Thanks, so in example 1 have I only allocated 50% of CPU resources to the VM? and have 50% spare (minus bit for host)
I understand that if you allocate a single core to a VM and it only uses a proportion of that then its not going to make a difference adding another 20 cores to it as they won't ever be needed, but if I wanted to allocate the entire CPU resource to the VMs how would I split it up in Example 2 with NUMA.

I saw this article which seemed to suggest that performance was increased with more sockets and a single core

http://blogs.vmware.com/vsphere/2013/10/does-corespersocket-affect-performance.html

I will be using Server 2012 R2 Standard for each of the VMs in example 2 which I believe now supports 64 sockets and 640 logical processors

so to maximise performance and allocate all CPU resources would I use:

VM1 - 2 sockets, 1 Core     VM2 - 4 sockets, 1 core     VM3 - 6 sockets, 1 Core

Or as Hyper Threading is enabled would it be:

VM1 - 4 sockets, 1 core     VM2 - 8 sockets, 1 core     VM3 - 12 sockets, 1 core

For reference (VM1 will be running Active Directory and Files), VM2 will be running an application , and VM3 will be running a terminal server

0 Kudos
NuggetGTR
VMware Employee
VMware Employee
Jump to solution

That article only comes into play if you are assigning more than 8 vcpus to a VM, this is when the underlying NUMA is shown to the VM, anything less ESXi will handle all of that for you, so what ever the socket to core config it only plays a part when you hit the 9vCPUs or above.

For both your examples specifically the first one I would suggest never allocate logical CPUs if you can help it. while it is saying it has 12 cores only 6 of them are real. Some workloads this may work well but if you assign a VM 12 vCPUs in this situation the guest thinks it has 12 full cores and will use them as such which can dramatically kill your performance. ESXi will use hyper threaded cores when its ok to do so and when it will not cause contention or performance problems.

For example 2 if you assign over 8vCPUs so 9 and up it is best to leave it 1 socket 1 core if licensing allows you too. otherwise matching the underlying NUMA is a must. But as the old saying goes more is not better, infact more can cause performance issues always assign a VM what it needs when its sharing the resources with other VMs, right sizing is key to a well running environment.

Cheers

________________________________________ Blog: http://virtualiseme.net.au VCDX #201 Author of Mastering vRealize Operations Manager
xSequentialx
Contributor
Contributor
Jump to solution

Thanks, and by allocating a total of 12 logical cores rather than 24 how does this work with hyperthreading. Am i only using 50% of cores to the VM and then 50% to the host? or will it use the additional logical cores shown with hyper threading anyway even if I allocate 12 vcpu?

Currently at VM1 2 sockets, 1 core     VM2 - 4 sockets, 1 core     VM3 - 6 sockets, 1 core

0 Kudos
NuggetGTR
VMware Employee
VMware Employee
Jump to solution

No you can allocate more vCPU than you have. what you have stated there is fine. I usually go for a 6 to 1 ratio. for example with 12 cores we could have up to 72 vCPUS (this is all relative to workload type and VM size through)

I was saying you never allocate a single VM more than the physical cores as the guest OS on the VM thinks it has full cores to play with not hyper threaded cores..

But hyper threading can give use better ability to over commit the CPU resources as it intelligently uses the additional threads when performance will not be impacted. as long as all those VMs are not going to be running at 100% then you could add a number more with no real impact. If those 3 VMs you have listed were to use 100% each you would be using 100% of the host CPU not 50%. never use logical cores when it comes to capacity calculations only physical cores

Cheers

________________________________________ Blog: http://virtualiseme.net.au VCDX #201 Author of Mastering vRealize Operations Manager
0 Kudos