Sashkin - Fotolia
How many Hyper-V virtual processors should I configure per VM?
There isn't a set number of virtual processors you should configure for a Hyper-V VM, but there are steps you can take to ensure your workloads receive enough processor resources.
When configuring Hyper-V virtual processors for a VM, you must ensure the workload has enough resources to run smoothly, but not so much that resources go to waste. A best practice is to start with two virtual processors and go from there, but there are additional steps you should take beforehand to reduce CPU overhead and gauge performance.
First, it's important to understand that a VM's CPU is equal to the number of threads it can execute at a given time. If your Hyper-V host has only two CPUs, you can't allocate more than two vCPUs to a Hyper-V VM.
A Hyper-V VM can operate successfully with one vCPU if it only needs to run OS processors because they don't require as much processing power. However, when it comes to deciding how many Hyper-V virtual processors you need for VMs that run line-of-business applications, the processing power required by the VM completely depends on the applications running inside it.
Although you can follow the best practices for configuring virtual processors provided by the application vendor, you might not want to follow exactly what is written if you have other critical production VMs that might require more processing power. There is no hard rule when it comes to configuring Hyper-V virtual processors for a VM. You need to check how a new VM performs on the Hyper-V host.
I recommend following this approach:
Step 1: Install a VM with the latest OS and make sure to install the latest Integration Services pack. Integration Services provide Microsoft Virtual Machine Bus drivers that can significantly reduce CPU overhead.
Step 2: Keep all of the other VMs running on the same Hyper-V host so you can see how the new VM will behave while other production VMs are in use.
Step 3: Configure the new VM to run with two virtual processors to start. It's absolutely necessary that you start by assigning two virtual processors to the new VM before you decide to increase that number.
Step 4: Detect bottlenecks using Performance Monitor. Next, check if the VM can work efficiently with two Hyper-V virtual processors. Use Performance Monitor on the host and check the Hyper-V Hypervisor Virtual Processor: Total Runtime counter. If the counter shows over 90% for the virtual processor, consider adding more virtual processors to the new VM and then repeating this step.