ESXi

 View Only
  • 1.  Adding CPUs to SMP is not always advantageous

    Posted Feb 06, 2011 10:47 AM

    Hi,

    I was going through the  best practices for using vmware virtual SMP technology.

    However, i came across the fact that adding cpus to the smp system does not always increase the throughput. i could read the reasons explained why it is so.

    But i could not quite understand it as it is completely new for me,

    Please could some one explain me the same in simple words why is it not always advantageous to keep adding more CPUs to SMP system.

    Thanks.



  • 2.  RE: Adding CPUs to SMP is not always advantageous
    Best Answer

    Posted Feb 06, 2011 12:33 PM

    I try to keep it simple,although CPU scheduling is not really simple :smileywink:

    All CPUs/cores are shared between the host itself and all of the virtual machines and each of them need sufficient CPU cycles to work with the performance you would expect. If you assign multiple vCPUs to a VM the CPU scheduler has to make sure the number of virtual CPUs is available at the same time to execute commands. As an example, assuming you assign 4 vCPUs, the scheduler would have to wait until 4 cores are available. To achieve this it has to pause the first cores until the 4th one is available. During this time the paused cores are not available for other processes.

    In addition to that, more vCPUs usually don't add much performance to a VM unless the applications running on the VM are optimized to use multiple CPUs.

    for details see http://www.vmware.com/resources/techresources/10131

    André



  • 3.  RE: Adding CPUs to SMP is not always advantageous

    Posted Feb 06, 2011 12:47 PM

    CPU scheduling has become a lot better in vSphere 4.1 so it doesn't hurt performance as bad to give a VM 2 vCPUs as it did in the past.  But I still try to give VMs only as much as they need in terms of memory and CPU to use resources as efficiently as possible.  You should look at your applications to determine if they can take advantage of the extra CPUs first before adding extra.  Applications like Exchange and SQL can take advantage and may show increased performance with extra vCPUs.  Don't be afraid to use vSMP, but also don't use it unless the guest can take advantage of it and you really need it.  As A.P. said it affects how the CPU scheduler works so it can impact your design.  Use it when you need it and when the application supports it and you will see the benefits.  Matt My blog: http://www.thelowercasew.com



  • 4.  RE: Adding CPUs to SMP is not always advantageous

    Posted Feb 07, 2011 02:23 AM

    When using multiple cpus I like to keep a check on on the %CSTP in esxtop.  This keeps track of the amount of time the cpu is spent waiting to co-scheduled.



  • 5.  RE: Adding CPUs to SMP is not always advantageous

    Posted Feb 07, 2011 05:59 AM

    Thanks everyone for your information.

    Thanks.