When selecting a CPU for virtual Infrastructure, it is important to know the features required in the physical processor for better performance. Hyper-Threading is one of those features, which in some cases can boost up the performance by using CPU resources more efficiently and allowing two different tasks to schedule execution resources on the same underlying physical core.
In the traditional processor (or without Hyper-Threading enabled), when a compute task (thread) is in execution cycle, some CPU resources may still be unused, But in the case of Hyper-Threading (HT) enabled CPU, An extra set of registers make available of those resources to the second thread and the processor acts like it has two logical cores, yet has only one.
For example, suppose your system has one physical CPU installed with two cores (Dual-core processor); typically, your operating system will see the two logical processors (1 core = 1 processor). Still, if you enable the Hyper-Threading (HT) feature in BIOS, your processor will pretend to have 4 cores, and the operating system will treat like there are 4 logical processors assigned to that.
Hyper-Threading Technology is the proprietary term used by Intel, but the general term is Simultaneous Multithreading (SMT). It allows the processor to schedule two separate execution contexts per core of a physical CPU and a rapid switch between the execution context. During the execution of one compute task (thread) other thread goes into a wait state which means when both the logical processors need to execute the compute task at the same time then one logical processor executes the task. Another processor’s thread has to go into ‘wait’ state and vice versa. That is why it does not perform as good as two physical core processor.
In VMware vSphere, you can see if the HT is enabled or not in the host’s BIOS. In the above example, when the HT is disabled, it will show only 2 logical processor but in the case of HT enabled, it will show 4 logical CPUs, and you can create 4 virtual machines by assigning 1 vCPU to each. However, you can also create 3 VMs by assigning 1-1 vCPU to two VMs and the rest 2 vCPU to 1 (as shown in the below figure) or 2 VMs by assigning 2 vCPU to 2 VM or 1 VM by giving all 4 vCPU.
When the number of logical processors assigned to VMs is more than the physical core is called over-commitment.
But in the first scenario, if all 4 VMs try to execute their tasks at the same time, they will require 4 physical cores for execution, but in actual they have only 2 physical cores. In that case, execution resource would be available only for two parallel tasks of two VMs (out of four), and the rest of the two tasks of two VMs would have to be in the wait state. That is why sometimes it seems like the processor is performing slightly down.
If you look at CPU performance in vSphere (in the above scenario), you would see that each logical CPU (vCPU) is 50% utilized, and the physical core would be at 100%.
The below counters for the HostSystem object in vSphere provide this information:
cpu.utilization – Provides statistics for physical CPUs.
cpu.usage – Provides statistics for logical CPUs. This is based on CPU Hyper-Threading
In all cases, performance is very much dependent on application architecture. It may result in rising as well as fall in performance using Hyper-Threading Technology, So discuss with your application architect before using this technology.
Check out some more blogs:
- The ABC of SDN (Software-Defined Networking)
- Configuring AWS Greengrass Core on VMware vSphere
- Deploying AWS Greengrass on VMware vSphere
- VNF Manager vs NFV Orchestrator (VNFM vs NFVO)
- Network Functions Virtualization (NFV)
- What is Hyper-Threading?
- Virtual Networking in VMware Workstation
Finally, If you like my blog, Please Share…