Should You Use Hyperthreading with VMware?

The answer, as it so often is, is "it depends."

One topic hotly debated throughout the history of server virtualization is that of hyperthreading. Some claim that hyperthreading can increase a VMware host's performance, while others claim that hyperthreading actually degrades performance. So what does VMware have to say about hyperthreading?

According to VMware (find it here), "Hyperthreading performance improvements are highly application-dependent, and some applications might see performance degradation with hyperthreading because many processor resources (such as the cache) are shared between logical processors." This does not necessarily mean that you should avoid hyperthreading, but you do have to be smart about how you use it. 

Before I explain what I mean, I want to take a moment and explain a bit about hyperthreading. Most modern CPUs contain multiple cores. The concept of hyperthreading predates that of CPU cores. Hyperthreading was originally introduced with the Intel Pentium IV as a way of allowing multiple threads to run simultaneously on a single socket. Today, CPU cores have largely replaced hyperthreading, but there are still some systems that support hyperthreading. Some CPUs combine the technology by supporting hyperthreading inside of cores.

So with that said, here is the reason why admins must be careful about using hyperthreading. Although hyperthreading does allow two threads to run simultaneously, most of the socket's (or core's) resources (such as cache memory) are shared between the two threads. If you were to simultaneously run two CPU intensive workloads on a hyperthreaded core, performance would likely suffer. The performance benefits derived from hyperthreading are based on the idea that shared CPU resources may not be in constant use. As such, two threads can safely share resources that would otherwise be underused. In the case of CPU-intensive threads however, the two threads would probably each use about half of the core's total capacity.

Two Logical Processors
As an administrator, the important thing to know is that a hyperthreaded core appears to ESXi as if it were two logical processors. Logical processors that share a core always have consecutive CPU numbers. For example, a hyperthreaded core might contain logical processor numbers 0 and 1. This is important to know, because VMware makes it possible to bind a VM to a logical processor. Therefore, if you were to bind one VM to CPU 0 and another to CPU 1, and those logical CPUs existed on the same core, you would be creating CPU resource contention for the VMs. VMware further explains this concept here.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.


Subscribe on YouTube