VMware Cloud Community
benoshea
Contributor
Contributor
Jump to solution

DRS Clusters and CPU resource allocation

Hi All,

I have a question regarding how CPU resources are allocated to Guests in a DRS environment. I was under the impression that all physical CPU resources are completely abstracted from the Guest VM. However, I am seeing the following behaviour...

- I have a DRS cluster with two ESX hosts ~59GHz of total CPU resources available. Physical ESX hosts have multiple multi-core 2.9GHz CPUs (I don't have specifics handy right now but that is irrelevant)

- I have a linux Guest running RHEL 3.0 which seems to top out at just under 2.9GHz.

Now there are plenty of unreserved cpu resources available to the cluster, however this particular VM can't seem to grab any more CPU allocation than just under 2.9GHz.

So my question is this: Are VMs limited in CPU resources to the maximum resources available to a single physical CPU on the host, or should it be able to grab more resources from the DRS cluster? (Assume a single vCPU guest), I can't seem to find any material that states in black and white whether this is the case?

If a VMs processing power is limited to the total CPU resources of a single physical CPU in the host, what is best practice for a machine requiring more CPU resources? Adding another vCPU (and running vSMP)? I was under the impression that vSMP should be avoided unless a particular VMs workload could truly take advantage of SMP?

Cheers,

Ben

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
mdri
Enthusiast
Enthusiast
Jump to solution

Ben, yes, each vCPU is limited to the resources of one CPU-- there is no aggregate of CPU resources per VM. Ultimately, a VM's vCPU's threads are given to only one CPU. The only way to improve performance of the VM is just what you wrote-- add vCPUs if the guest OS and applications can utilize them. The cost is that all vCPU threads for a VM must be scheduled together, so if the VM can't make use of them, the wait time for this and other VMs could increase, degrading their CPU performance.

A bit more info... An ESX host has one or more Hardware Execution Contexts (HECs). Each core is one HEC. Each hyperthreading instance of a CPU is also one HEC. So, for a host with two quad core CPUs and without hyperthreading, the totals number of HECs on the host is eight. Another example; for a host with two single core CPUs and each CPU supports hyperthreading, the total number of HECs is four.

Each vCPU makes use of one HEC. A VM with two vCPUs will use two HECs. According to VMware, ESX will try to prioritize different sockets for use by the VM before two cores on the same socket, and that before hyperthreading HECs on the same socket.

View solution in original post

0 Kudos
2 Replies
mdri
Enthusiast
Enthusiast
Jump to solution

Ben, yes, each vCPU is limited to the resources of one CPU-- there is no aggregate of CPU resources per VM. Ultimately, a VM's vCPU's threads are given to only one CPU. The only way to improve performance of the VM is just what you wrote-- add vCPUs if the guest OS and applications can utilize them. The cost is that all vCPU threads for a VM must be scheduled together, so if the VM can't make use of them, the wait time for this and other VMs could increase, degrading their CPU performance.

A bit more info... An ESX host has one or more Hardware Execution Contexts (HECs). Each core is one HEC. Each hyperthreading instance of a CPU is also one HEC. So, for a host with two quad core CPUs and without hyperthreading, the totals number of HECs on the host is eight. Another example; for a host with two single core CPUs and each CPU supports hyperthreading, the total number of HECs is four.

Each vCPU makes use of one HEC. A VM with two vCPUs will use two HECs. According to VMware, ESX will try to prioritize different sockets for use by the VM before two cores on the same socket, and that before hyperthreading HECs on the same socket.

0 Kudos
ChrisDearden
Expert
Expert
Jump to solution

"If a VMs processing power is limited to the total CPU resources of a

single physical CPU in the host, what is best practice for a machine

requiring more CPU resources? Adding another vCPU (and running vSMP)? I

was under the impression that vSMP should be avoided unless a

particular VMs workload could truly take advantage of SMP?"

its possibly also worth considering the design of the service that you are using that VM to provide , does it scale out rather than up ?

If this post has been useful , please consider awarding points. @chrisdearden http://jfvi.co.uk http://vsoup.net