Solved

VMware – question regarding # of cores per virtual machine

Posted on 2011-02-10
5
1,024 Views
Last Modified: 2012-05-11
Hello,
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).

Thanks!
0
Comment
Question by:steno1122
5 Comments
 
LVL 28

Expert Comment

by:bgoering
Comment Utility
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
0
 
LVL 1

Expert Comment

by:Calebs_Dad
Comment Utility
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.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010184
0
 
LVL 42

Expert Comment

by:paulsolov
Comment Utility
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.
0
 
LVL 1

Expert Comment

by:Calebs_Dad
Comment Utility
0
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
Comment Utility
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.

BUT....

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.

 http://kb.vmware.com/kb/1005362

Determining if multiple virtual CPUs are causing performance issues

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1005362

Determining if multiple virtual CPUs are causing performance issues

http://www.yellow-bricks.com/2008/07/07/multiple-virtual-cpu-vms/

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This Micro Tutorial steps you through the configuration steps to configure your ESXi host Management Network settings and test the management network, ensure the host is recognized by the DNS Server, configure a new password, and the troubleshooting…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now