VMware Cloud Community
santosh42
Enthusiast
Enthusiast
Jump to solution

Adding CPUs to SMP is not always advantageous

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
a_p_
Leadership
Leadership
Jump to solution

I try to keep it simple,although CPU scheduling is not really simple Smiley Wink

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é

View solution in original post

Reply
0 Kudos
4 Replies
a_p_
Leadership
Leadership
Jump to solution

I try to keep it simple,although CPU scheduling is not really simple Smiley Wink

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é

Reply
0 Kudos
VMmatty
Virtuoso
Virtuoso
Jump to solution

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

Matt | http://www.thelowercasew.com | @mattliebowitz
mittim12
Immortal
Immortal
Jump to solution

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.

santosh42
Enthusiast
Enthusiast
Jump to solution

Thanks everyone for your information.

Thanks.

Reply
0 Kudos