0

I have ran CPU stress test on linux HyperV VM. Linux reports 100% CPU utilization, but "Hyper-V Hypervisor Virtual Processor(*)\%Total Run Time" metric shows about 60-70%.

Is it possible to obtain "real" CPU utilization for Guest system? How to make "Hyper-V Hypervisor Virtual Processor(*)\%Total Run Time" 100%?

John
  • 542
  • 5
  • 16

2 Answers2

3

You can find physical core use on the host with “\Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time” (LPTR)

If you have more virtual processors than logical processors (cores) they will context switch and you get low virtual use; do not oversubscribe processors. The hypervisor has a small amount of overhead so you need a core or two more than you have vCPUs to approach 100% guest utilization.

Consider running this load test on bare metal as a comparison. That will show what 100% looks like on the processor.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • But "Guest operating system processors do not have a set affinity to physical processors/cores", anyway that cannot help me to find CPU usage on Guest OS – John Feb 08 '16 at 18:07
  • Answer the more basic question of if you are oversubscribing logical CPUs first. For example, 4 vCPUs running on 2 processors, the guest get about half the time on average. 2 vCPUs on 4 processors, logical use < 75%, then guest is using all of 2 cores, minus some small overhead. – John Mahowald Feb 10 '16 at 01:10
  • I tried 2 cases: 1 vCPU running on 16 cores, 16 vCPU running on 16 cores – John Feb 10 '16 at 13:43
1

I can think of two different interpretations of your question:

1) How much of the time was the Linux VM idle?

2) How much of the time was the Linux VM running code?

The answer to question #1 is that your Linux VM isn't idle. The fact that Linux thinks that it is 100% busy means that it was idle 0% of the time.

The answer to question #2 is 60-70%. The VPs of your Linux VM were running 60-70% of the time.

Perhaps you're asking a third question: Why are my Linux virtual processors only running 60-70% of the time?

To answer that, you'd have to look at other factors. Perhaps there are other VMs eating up time. Perhaps the Linux VM doesn't have paravirtual drivers (Integration Components) installed and its VPs are pausing because they are attempting to interact with "fully virtualized" hardware, which means that they're trying to do I/O and other operations in a way that would be appropriate for a physical machine and the hypervisor is spending time emulating those physical machine aspects.

Jake Oshins
  • 5,146
  • 18
  • 15
  • Host has 16 cores, VM is using only 1, other VMs are off. Linux Integration Services is installed – John Feb 10 '16 at 13:35
  • I tried Ubuntu instead of Cenots (IS 3.0). And with Ubuntu I reached 98-99% utilization. So maybe Integration Services version is the key. – John Feb 11 '16 at 17:01