Mac – CPU usage in virtual machines

cpughzhyper-vvirtual machinevmware

I have a host machine with 1 logical processor running at 2.0GHz with 2 VMs running. Each VM is running at 100 % utilization (according to Task manager inside the VM). I realize this "100%" is not accurate in the sense that actually, each VM is utilizing about 50% of available CPU resources of the host machine. Only if I stopped one of the VMs would the running VM really be using 100% of the physical CPU.

How does this process work? If the physical processor runs at 2.0GHz, are we essentially creating two virtual processors that each run at 1.0GHz? So when we see 100% utilization on both VMs, we are talking about 100% of 1.0GHz on each? How is that percent utilization derived in the first place?

Thank you!

Best Answer

The usage that you see inside the virtual machine is the percentage of the time it wanted the CPU, whether it got it or not. Essentially, 100% means 100% of the CPU available to that virtual machine.

If the physical processor runs at 2.0GHz, then so do the virtual processors. However, because there is only one actual core, only one of the virtual processors can be running at a time. When you see 100% utilization on both VMs, you are talking about each VM always wanting as much CPU as it can get. Typically, they will each get close to 50% of the available CPU.

Don't say things like this: "So when we see 100% utilization on both VMs, we are talking about 100% of 1.0GHz on each?" That's basically nonsense. If you get to use a car that goes 50 miles per hour every other day, we don't describe that as 100% of 25 miles per hour. Rates don't work that way. The CPU has some capacity to do work, and the virtual machines share that. If each wants all they can get, then each gets around 50% of the CPU's capacity to do work. 2.0GHz is the core clock speed, not the capacity to do work. So it makes no sense to divide that.

Related Question