2

Assume I have a physical ESX host with ONE quad-core processor and hyper-threading disabled. This means it has a total of 4 physical cores or pCPUs. I create a single VM on this VMware host. I assign this VM to have 1vCPU and put no CPU limit.

Question: If the VM is running a "cpu killer" application that keeps demanding more and more cpu cycles, could the VM end up fully consuming all the 4 underlying physical cores at any given moment in time?

I think the answer is no. A single vCPU VM can only consume at most 1 physical core worth of capacity at any given moment in time. So, in my example, since there are no other VMs running, VMware will schedule the VM to run on one physical core, When that physical core is 100% consumed, the VM's CPU utilization will latch to 100% and that's it. The other 3 cores will mostly sit idle. Correct?

2 Answers2

3

If the VM is running a "cpu killer" application that keeps demanding more and more cpu cycles, could the VM end up fully consuming all the 4 underlying physical cores at any given moment in time?

No.

So, in my example, since there are no other VMs running, VMware will schedule the VM to run on one physical core, When that physical core is 100% consumed, the VM's CPU utilization will latch to 100% and that's it. The other 3 cores will mostly sit idle. Correct?

Yes, that's correct.

Virtualization isn't magic - one core is still one core, and if allocated a single CPU, your VM will only ever be able to consume 1 core's worth of CPU cycles.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • Technically: a CPU has certain characteristics. a Virtual CPU is actually one core assigned to the VM physically for a specific timeslice. THe OS then deal with it. But it still has only one core available. – TomTom Sep 27 '13 at 06:10
-1

it depends if your program is coded with multiple threads. Eg you may ask that one thread calculate something in parallel to another thread doing some other task.

Now, if you only have one core .. then your program threads can only run in tandem (one behind the other) .. and they wont be executed in parallel at all.

However, if you are in a VM world your "core" is actually your vCPU. VMware is smart enough to recognise that tandem threads on a vCPU can be spread over multiple physical cores. Assuming you have not turned on CPU-affinity, and assuming there are spare cores at the time, VMware will be able to take advantage of this opportunity.