Hyper-V CPU Scheduling–Part 4

Now that I have discussed the various CPU resource controls that are available for Hyper-V virtual machines – I thought I would take a moment to answer a couple of the common questions I have heard about CPU resource control:

Can you use the virtual machine limit, reserve and relative weight all at the same time? And what actually happens?

Yes, you can.  By default all of these controls are effectively disabled – but you can configure all of them at the same time.  The way they interact is that the reserve defines the lower bound of CPU resource, the limit defines the upper bound, and the relative weight affects how CPU is handled between these two bounds.

That said – I do not know of anyone who actually uses all three on a regular basis.  Most people use one or maybe two of the controls.

Why do you use percentage for the limit and reserve – and not MHz / GHz?

Many people find it easier to think in MHz / GHz rather than percentage of a physical computer.  They also argue that using a percentage means that as you move a virtual machine from computer to computer you may get different amounts of resource depending on the underlying capability.

This is something that has been discussed extensively on the Hyper-V team, and while I do believe there is some merit in this approach, there are a number of reasons why we chose to use a percentage instead.  Two key ones are:

 

  1. Predictable mobility

    If all your virtual machines have a reserve of 10% – you know that you can run 10 of them on any of your servers.  The same would not be true if they all had a reserve of 250Mhz.  Given how important virtual machine mobility is to our users – we believe that this is something that needs to be easy to manage.

  2. Not all MHz are the same

    1GHz on a Pentium IV is much slower than 1GHz on a Core i7.  Furthermore – newer processors tend to be more efficient at virtualization than older processors, so the difference between the “bang for buck” that you get out of each MHz varies greatly between processor types.  This means that in reality – defining a reserve or limit in MHz / GHz does not really give you a great performance guarantee anyway.

Okay, there is more that I could say here – but I will leave that for another day.

Cheers,
Ben