Hyper-v virtual machine CPU ratio

Hi experts,

Can someone please give me a precise formula for calculating how many cpus are available to be allocated to vms and what the current ratio is?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jeremy WeisingerSenior Network Consultant / EngineerCommented:
1 vCPU per core -1 is how I usually plan things.

Here's a nice article: https://www.experts-exchange.com/articles/13256/Some-Hyper-V-Hardware-and-Software-Best-Practices.html
Check out the Virtual CPUs and CPU Cores section.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
We allocate on 5-6 vCPU per Core in the physical server, there is not really a formula...most values are found by experience.

So that could be 5 VMs each with 1 vCPU per Core in the physical server.

Have a read of fellow Expert Phil's article

Some Hyper-V Hardware and Software Best Practices
Jeremy WeisingerSenior Network Consultant / EngineerCommented:
We allocate on 5-6 vCPU per Core in the physical server.
Oh, interesting, I always thought there'd be too much competition for the core if overcommitting.
SolarWinds® Network Configuration Manager (NCM)

SolarWinds® Network Configuration Manager brings structure and peace of mind to configuration management. Bulk config deployment, automatic backups, change detection, vulnerability assessments, and config change templates reduce the time needed for repetitive tasks.

cmatchettAuthor Commented:
Philip ElderTechnical Architect - HA/Compute/StorageCommented:
As indicated in my article (thanks Jeremy) there's a pretty good explanation on how a VM's vCPU and the CPU's physical core work together.

The rule of thumb is pretty simple: More vCPUs = More parallel threads to pump through the CPU processing pipeline.

In a dual CPU setting configuring the VM to have more vCPUs than cores on one physical CPU means the pipeline needs to juggle the threads across the two CPUs to keep them in parallel. This juggling costs CPU cycles and thus performance.

Configuring VMs with high vCPU counts for databases that have high transactions rates tend to get bitten by this one. Another workload that can be hit by this is Remote Desktop Services. Basically, any workload that can process in parallel (more than one thread for the app).

Having more VMs with 1 & 2 vCPU counts tends to perform much better, on the same box, than having a series of VMs with 4+ vCPU counts on a dual six to eight core per CPU setup.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
Remember the Hypervisor has a scheduler! and moves the process across all Cores in the Host, it's not fixed and stuck to a core!
Lee W, MVPTechnology and Business Process AdvisorCommented:
You need to understand how virtualization works.

You can easily overcommit CPUs and IN GENERAL, you probably SHOULD over commit.  But as with just about everything IT, the answer is "it depends" - it depends on what you do with the VMs.

As a rule of thumb, I start ALL VMs off with 2 vCPU.  I increase that number ONLY if the VM shows it needs more CPU time based on the VM's CPU usage.  (My Exchange server has 3 vCPU, but all my other servers have 2 in a system with 8 physical cores and 16 total threads).

I like 2 vCPU because sometimes, threads go nuts and eat CPU time causing the VM to get unresponsive.  By giving 2 vCPU, you minimize the risk of the VM getting unresponsive due to misbehaved threads while ensuring optimal performance with thread scheduling by the host.  (See Philip's article referenced above or the SECOND HALF of my article, "Virtual or Physical" - https://www.experts-exchange.com/articles/27799/Virtual-or-Physical.html)
cmatchettAuthor Commented:
seeing as it's your article that helped me the most.  I am not sure if i should award the points to the person who gave me the link initially?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.