VMware Cloud Community
grob115
Enthusiast
Enthusiast

Proper utilization of Hyper Thread

Hi, am wondering if I'm taking advantage of the HT available on my Sandy Bridge E3-1230.  There are 4 physical cores (ie 8 hyper threads available) on the server, and I'm running only 4 VMs each assigned with 1 vCore.

Saw the following in the guide when I clicked on Help within the VM's Properties -> Resources area.

The way I intprereted this is with "Internal" setting, I need to assign 2 vCores (ie add 1 vCore to each of my VMs) and by doing so, 2 CPUs are available per VM (as indicated by the Linux top command and pressing 1).  Both CPUs per VM will be allocated to and share the same 1 of the 4 physical cores on the E3-1230.

However, if I have anything more than 2 vCores (say as an example I assign 3 vCores to each of the VMs), every VM will have 3 CPUs available (as indicated by the Linux top command and pressing 1).  However, it'll also be switched into the "None" setting, and every one CPU as seen within the top command will consume the whole of one physical core.  In other words, rather than running two threads per physical core, it is now running only one thread per physical core.

Is the above interpretation correct?  Also, anyone know if CentOS 5.5 64-bit is compatible with the Hot plug feature?  If not, can I power down the VM, add an additional core, and power it back up?  I see the disclaimer "Waning:  Changing the number of virtual processors after the guest OS is installed may make your virtual machine unstable."

Hyperthreading Sharing
The Hyperthreading Sharing group provides detailed control over whether a virtual machine should be scheduled to share a physical processor core (assuming hyperthreading is enabled on the host at all).
Any – (default) The virtual CPUs of this virtual machine can freely share cores with other virtual CPUs of this or other virtual machines.
None – The virtual CPUs of this virtual machine have exclusive use of a processor core whenever they are scheduled to it. The other hyperthread of the core is “halted” while this virtual machine is using the core.
Internal – On a virtual machine with exactly two virtual processors, the two virtual processors are allowed to share one physical core (at the discretion of the ESX/ESXi scheduler), but this virtual machine never shares a core with any other virtual machine. If this virtual machine has any other number of processors than two, this setting is the same as the None setting.

0 Kudos
4 Replies
AWo
Immortal
Immortal

Each vCPU runs on a particular core. Which one is decided by the ESX scheduler at a given point of time. Cores do real work. CPUs generated by HT don't.

Using HT helps freeing up the work-to-do queue of the OS using HT somewhat faster, as it "thinks" there are even more CPUs where it can delegate work to. In fact, this work doesn't end up in a core directly but it is shifted to the CPU scheduler.

So the (IMHO small) performance gain comes from the fact, that the OS scheduler is free again to take new work a little bit faster. But the only of physical cores is responsible for the work which can be done in parallel and this way faster.

That is what HT is doing.

I assume you're right, that with "None" other tasks from other guests are not allowed on that core.

Nachricht geändert durch AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
grob115
Enthusiast
Enthusiast

Thanks I understand what you're saying with HT.  However, what I'm trying to figure out is if there's a danger of assigning more than 2 vCore per VM.  It appears the None setting means rather than having 2 threads per physical core, it only has 1 thread per physical core.  So rather than assigning 8 threads as scheduled by the 4 VMs to the 4 physical cores, a total of only 4 threads can be scheduled by the 4 VMs to the 4 physical cores.  Is that what the manual is trying to say?

0 Kudos
AWo
Immortal
Immortal

It is not about HT if you want to decide how many vCPU's to use. It is about the real cores. Start with as less vCPU's as possible and assign more if you feel there's a need to. Don't assign more than 50% vCPU's than you have cores to a single guest .

Check: http://www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf

AWo

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
0 Kudos
grob115
Enthusiast
Enthusiast

Okay thanks.  Basically looks like it all works by the concept of Share / Reservation / Limit.  By changing the vCore assigned to a VM from 1 to 2, I see the Share changed from 1000 to 2000 for Normal, and Limit changed from 3200 to 6200.  Based on the "VMware vSphere™ 4:The CPU Scheduler inVMware ESX™ 4" and "vSphere Resource Management Guide", it appears the ESX scheduler will take into account whether the vCore is running on a pCore with or without one hardware threaded halted, to ensure that the load is distributed across all the vCores on all VMs as per the Share / Reservation / Limit setting.

It also appears that Cent OS 5.5 64-bit doesn't work with the CPU hot plug functionality because while I can add more vCores with the guest powered off, I can't enable the hot plug functionality (it's greyed out).

0 Kudos