VMware ESXi – Performance Comparison with Two vs Four Cores

vmware-esxi

We had a VMWare VM at work with two cores allocated to it that ran a pretty heinous process in IIS. Under load the process was maxing out the CPU usage on both cores, so we asked our system engineers to present the other two cores of the physical processor to the VM. The engineer immediately said that this would not improve performance at all, but would make the VM perform worse. He dismissed the reason for his statement had anything to do with the ESX server's capacity, or resource contention.

That statement didn't make much sense to me, and I'm wondering how what the engineer said could be true. Are there actually cases where four cores presented to a VM would cause worse performance than two cores on the same physical hardware? Let's assume an ideal situation where there's only one VM on the host server, so nothing is being shared with other OS instances.

I believe the physical server had a single quad core processor, and was most likely hosting multiple VMs. I don't really know what version of ESX was running on the host, nor do I know with certainty what the physical processor config was, but from within the VM I had access to, I saw two 3.33 GHz AMD processors.

In the end, I never got to test the engineer's assertion out because (while we were trying to get the VM upgraded) we were able to optimize the process and reduce it's CPU consumption, and 2) we ended up migrating to a different VM on another ESX server which had four cores presented to it.

Best Answer

I'll chime in here and say that what your engineer was likely talking about is the fact that a VM with multiple vCPU's has a distinct disadvantage when scheduling CPU cycles. A 1 vCPU VM can execute instructions as soon as a single core is available. If a VM has 4 vCPU's, then it literally cannot execute any instructions until 4 cores are available.

If your box has a decent number of VM's on it, this definitely could slow you down b/c your VM will have to wait in line for 4 cores to free up. It could also slow the other VM's down because it will have all 4 cores tied up at once.

I don't want to get into Hyper-Threading and all that, but above is a simple explanation of what I think your guy might have been referring to. Although he may not have done the best job explaining it.