Microsoft Corrects The vCPU:pCPU Ratio for Hyper-V

Last year, those of us not at TechEd USA heard that Microsoft would support a 12:1 ratio of virtual CPUs.  In other words, for every physical logical processor, we’d get support for up to 12 virtual CPUs.

Ah … but all was not as it seems, as a blog post that appeared in my feeds yesterday indicated.  Microsoft noticed “some confusion” about the 12:1 ratio. 

There are two issues.

1) 12:1 ratio

The 12:1 ratio applies only to when you are dealing with VDI.  In other words, the virtual CPUs must be in Windows 7 virtual machines on a host running W2008 R2 SP1.  Microsoft only tested the 12:1 ratio in a VDI scenario.  A pCPU with 6 logical processors can support up to 72 vCPUs as long as they are in Windows 7 VMs in a VDI scenario.

The old 8:1 ratio still applies in a server virtualisation scenario.  A pCPU with 6 logical processors can support up to 48 vCPUs in a non-Windows 7 VDI scenario, e.g. when you are running server workloads.

2) Logical processor

In Microsoft’s language, a logical processor is not a core.  It’s either a core or a thread depending on the CPU in question.  In other words, does the CPU have Hyperthreading?  If it does, then how you calculate logical processors changes.

Hyperthreading is a feature in Intel processors where a core can have 2 threads of execution.  It comes at a cost, but it is feasible to use it in some scenarios. For example, Microsoft supports it when using Hyper-V for VDI.  In that case, a 6 core Xeon processor will have 12 logical processors (6 cores * 2 threads with Hyperthreading enabled).  However, they recommend Hyperthreading is disabled when using Hyper-V for server workloads.  That’s because the nature of server workloads is different and isn’t suitable with the bottlenecks introduced by Intel’s Hyperthreading.  AMD on the other hand, do not do hyperthreading.  A 12 core AMD processor has 12 logical processors.

What’s it all mean?

It just aint that easy any more.  In the article we got some formulas to use for calculating maximum supported vCPUs.

In the case of Windows 7 VDI:

(Number of processors) * (Number of cores) * (Number of threads per core) * 12

Let’s work that out with our 6 core Intel Xeon on a dual socket (2 CPU) server, with Hyperthreading.

= 2 * 6 * 2 * 12

= 24 * 12 –

= 288 vCPUs

The same formula seems to apply when enforcing the 8:1 ratio:

(Number of processors) * (Number of cores) * (Number of threads per core) * 8

I’m not 100% positive if that’s assuming that Hyperthreading is enabled for the server workload, which is not recommended, but I think it might, and that is bad.  I’ll try to find out.

Oh, this stuff is probably all theoretical anyway.  There is a comment in the post saying “Vendor A responds 16:1 (with the qualifier that your mileage will vary…)”.  In the real world, mileage varies no matter what virtualisation platform you run.  That’s why MSFT gives us MAP … to determine the real CPU requirements to run our virtual workloads.  You don’t just magically require less CPU horsepower to run your workloads by virtualising them.  So if your assessment says that your 10 VMs need 8 * 6 core processors then you need 8 * 6 core processors, regardless of what some maximum supported figure says.

4 thoughts on “Microsoft Corrects The vCPU:pCPU Ratio for Hyper-V”

  1. Any mention of the vCPU assignments to a VM and how that impacts performance?
    For example, I have 2 cores and I assigm my VM 4 vCPU – thus the worker threads for the same VM happen on the same core at the same time.
    I realize that this does not happen on large servers, but folks using many small servers can run into this easy. And many folks these days have a tendency to assogn too much resource to a VM than is really needed or performs well. They just take the old physical experience and don’t try to understand the virutal experience and discover the new sweet spot.

  2. Hi Aidan, is there an update in vCPU:pCPU Ratio in 2012r2 Hyper-V? Do you have a Best Practice how much of vCPU’s you allocate to Fileservers or Domain Controllers? cheers, adrian

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.