• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1039
  • Last Modified:

VMware – question regarding # of cores per virtual machine

I have a question regarding the number of cores or CPUs you can assign a virtual machine.  Is there a number that would start to impede performance of the virtual machine?  The company that I work for recently hired a new IT manager.  He is very knowledgeable about VMware.  He said that virtual machines should not have more than one core or one CPU assigned to them.  He said assigning more cores can actually impede performance.  We are running ESXi 4.1 and I find it hard to believe that VMware allows you to assign up to 8 processors per VM yet using more than one CPU can impede performance.  The new guy has been working with VMware for years.  Is this something that maybe was true in early versions of VMware but isn’t true now?

I’m fairly new to VMware and was asked to virtualize a SQL server.  The physical server has two quad core processors.  I don’t feel comfortable virtualizing the server and only giving it one CPU.

Is this guy correct with his assumption that you should only assign one core or CPU per virtual machine for performance reasons or is he totally wrong?  Any insight or links to documentation that would prove him wrong would be appreciated (assuming he is wrong).

1 Solution
You introduce a bit of overhead whenever you introduce a SMP environment as compared to a one processor environment. That being said the answer to your question is "it depends." It depends primarily on the applications you are to be running in the vm as well as the processor requirements.

Rule of thumb - start with one and if the vm turns out to be processor bound then add another. If you add another and the vm doesn't need it, then there will be degredation. On the other hand, it there is significant load and an application that can take advantage of all those cores (like SQL for example) then by all means - it will run much better with multiple processors.

Hope this helps
The answer is no it will not impede performance as long as the server is part of the VMWare HCL.

I had the same point brought to my attention and after researching I found this article that describes it best.

Paul SolovyovskySenior IT AdvisorCommented:
unless you have a multithreaded application such as sql you will not take advantage of multiple vCPUs.  He is correct on the CPU side because the more CPUs your VM has the slower it may be.  The reason for this is that the vCPUs have to be queued up to do any work even though there may be only enough processing for a single vCPU.

As bgoering stated started with 1 and go from there.  With windows 2008 x 64 and up you can hott add CPUs on the fly if needed if you setup the VM correctly.
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
There is a general rule of thumb only allocate vCPU is you really need them and the operating system and applications can utilise them.

Over allocation of any resource can impede performance of the host, and in return impede performance of ALL the VMs.

On VMware Training courses theyn advise, only add additional vCPUs if required.

But Virtual Citrix/Terminal Servers and SQL servers (remember the licensing if you are per processor) are often given two vCPUs.


Sin­gle vCPU vs Mul­ti­ple vCPUs

Take a cau­tious approach to allo­cat­ing mul­ti­ple vCPUs to a VM, as you can cre­ate extra over­head by sched­ul­ing two or more vCPUs in a VM, which would be detri­men­tal to the per­for­mance of the VM.

To deter­mine if mul­ti­ple vCPUs assigned to your VM is caus­ing poor performance:

   1. Open a con­sole prompt on the ESX host or ini­ti­ate an SSH con­nec­tion to it. .
   2. Type esx­top and press Enter.
   3. On the CPU screen, check the %CSTP value. If this num­ber is higher than 100, the per­for­mance issues may be caused by the vCPU count. Try low­er­ing the vCPU count of the vir­tual machine by 1.

      Note: The %CSTP value rep­re­sents the amount of time a vir­tual machine with mul­ti­ple vir­tual CPUs is wait­ing to be sched­uled on mul­ti­ple cores on the phys­i­cal host. The higher the value, the longer it waits and the worse its performance.  Lowering the num­ber of vCPUs reduces the sched­ul­ing wait time.

To lower the vCPU count:
Note: The vir­tual machine must be pow­ered off to per­form these steps.

   1. Right-click on the vir­tual machine and click Edit Set­tings.
   2. Click CPUs.
   3. Use the Num­ber of vir­tual proces­sor drop-down to lower the vCPU count by 1.
   4. Click OK.
   5. If your vir­tual machine still expe­ri­ences per­for­mance issues, and if its ker­nel or HAL can han­dle switch­ing to a sin­gle vCPU, lower the vCPU count to 1.

      Warn­ing: If your vir­tual machine’s ker­nel or HAL can­not han­dle switch­ing to a sin­gle vCPU, unex­pected behav­iour may occur.


Determining if multiple virtual CPUs are causing performance issues


Determining if multiple virtual CPUs are causing performance issues


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.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now