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?
cmatchettAsked:
Who is Participating?
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.
0
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
0
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.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

cmatchettAuthor Commented:
0
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.
1

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!
1
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)
0
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?
0
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
Virtualization

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.