Solved

how to determine the correct number of cpus needed in a vsphere virtual server

Posted on 2013-01-11
25
513 Views
Last Modified: 2013-01-14
We are constantly getting asked to add more cpus to servers and also when
we are building new virtual servers we are getting asked to put in 4+ cpus
i have heard that in some cases more cpus = worse performance.
Is this still the case in newer versions of vsphere?
How can i find out
when its better to add cpus
when its better to remove cpus
0
Comment
Question by:dougdog
  • 13
  • 12
25 Comments
 
LVL 117
ID: 38766387
vSMP (virtual SMP) can affect virtual machine performance, when adding too many vCPUs to virtual machines that cannot use the vCPUs effectly, e.g. Servers than can use vSMP correctly :- SQL Server, Exchange Server.

This is true, many VMware Administrators, think adding lots of processors, will increase performance - wrong! (and because they can, they just go silly!). Sometimes there is confusion between cores and processors. But what we are adding is additional processors in the virtual machine.

So 4 vCPU, to the VM is a 4 Way SMP (Quad Processor Server), if you have Enterprise Plus license you can add 8, (and only if you have the correct OS License will the OS recognise them all).

If applications, can take advantage e.g. Exchange, SQL, adding additional processors, can/may increase performance.

So usual rule of thumb is try 1 vCPU, then try 2 vCPU, knock back to 1 vCPU if performance is affected. and only use vSMP if the VM can take advantage.

Example, VM with 4 vCPUs allocated!

My simple laymans explaination of the "scheduler!"

As you have assigned 4 vCPUs, to this VM, the VMware scheulder, has to wait until 4 cores are free and available, to do this, it has to pause the first cores, until the 4th is available, during this timeframe, the paused cores are not available for processes, this is my simplistic view, but bottom line is adding more vCPUs to a VM, may not give you the performance benefits you think, unless the VM, it's applications are optimised for additional vCPUs.

See here
http://www.vmware.com/resources/techresources/10131

see here
http://www.gabesvirtualworld.com/how-too-many-vcpus-can-negatively-affect-your-performance/

http://www.zdnet.com/virtual-cpus-the-overprovisioning-penalty-of-vcpu-to-pcpu-ratios-4010025185/

also there is a document here about the CPU scheduler

www.vmware.com/files/pdf/perf-vsphere-cpu_scheduler.pdf

See my EE Article on performance

HOW TO:  Performance Monitor vSphere 4.x or 5.0

Many VMware Admins make the mistaken of overcomitting processors, because they can. Start with a single and grow. (add more).

What are the physical requirements for the service, would the physical server require 4 processors?

We often create VMs for Clients, and ask they to test performance, if they are not satisfied after testing we look at performance graphs, CPU and Memory, and increase slowly.

Otherwise we would have some very silly VM requirements, because they do not often know, what to allocate.
0
 

Author Comment

by:dougdog
ID: 38766534
what is classed as high cpu ready?
i have attached a screenshot of a vm i have with 4 cpus and its cpu ready chart
is this high
cpu-ready.PNG
0
 

Author Comment

by:dougdog
ID: 38766547
this is from esxtop on 1 of my hosts
esxtop.PNG
0
 
LVL 117
ID: 38766561
what are you min and max readings?

it should be as low as possible, the higher the reading (milliseconds), the slower the VM is performing, and with many processors attached you see high readings.

is the VM performing okay?

you may want to experiment, and maybe drop a vCPU

what is the server?
0
 

Author Comment

by:dougdog
ID: 38766575
its a front end server running iis
min max readings ?
are thesew in the screenshots attached or do i need to look somewhere else
0
 
LVL 117
ID: 38766596
see here on the charts

CPU Ready
0
 

Author Comment

by:dougdog
ID: 38766605
did you open the attachments i sent
does this indicate high cpu ready
0
 
LVL 117
ID: 38766640
from that graph, it is high at that time.

look at my graphs, for a very busy, stressed out vSphere Data Protection appliance, with 4 vCPUs and 8GB of memory.
0
 

Author Comment

by:dougdog
ID: 38766656
the average on your appliance is 46.856
is this classed as high
what is the easiest way to go through all my virtual machines to see if adjusting the cpu count either up or down would be beneficial
seems complicated to know when to add more cpus and when to take away
0
 
LVL 117
ID: 38766700
that's low, it's in milliseconds.

but are your VMs slow?

is performance of your VM being affected?

you really need to have a baseline average over a few weeks.

if you look at your charts, it's at 75,000 miliseconds!

that's 75 seconds compared to my 45 miliseonds! (over a 1 minute)

I would use a monitoring tool, you could use Veeam One for FREE.

http://www.veeam.com/virtual-server-management-one-free.html

basically you should always start with 1, and then add more.
0
 

Author Comment

by:dougdog
ID: 38766739
ok so does that mean that machine was waiting over a minute to get all cores available before it could exexute
yeah users quite often complain systems are slow
0
 

Author Comment

by:dougdog
ID: 38766756
ok so ready and costop are used to monitor cpu over allocation
what are best indicators to monitor cpu under allocation
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:dougdog
ID: 38766772
also on my chart sometimes it spikes to 300000milseconds does this mean sometimes a wait time of 5 min
0
 
LVL 117
ID: 38766783
I'm not sure how much traffic your front end server deals with, but reducing the number of CPUs may help.

also depends on the host, and number of processors and cores available, and how many VMs you have running, and how they are setup.

Utilization of the Processor!

100% CPU!

also see this, which is in my EE Article

http://communities.vmware.com/docs/DOC-5420
0
 
LVL 117
ID: 38766799
your chart is very high, are all your VMs like this?

reduce cpus on a VM.
0
 

Author Comment

by:dougdog
ID: 38766932
so does that mean the machine was waiting for a minute to get resources or is that incorrect
0
 
LVL 117
ID: 38766961
it means that for  75,000 miliseconds of the previous sample period the vCPU was ready to run and not getting resources!

so you are correct.
0
 

Author Comment

by:dougdog
ID: 38766977
i have around 16 vms running on each esx server
the esx server has 2 quad core cpus
0
 

Author Comment

by:dougdog
ID: 38766989
even worse on that chart sometimes it spiked to 300000 surely that cant mean waiting nearly 5 min for resources

can it???
0
 
LVL 117
ID: 38766990
that should be fine, unless you give ALL your VMs,

4 vCPUs!

reduce vCPUs!
0
 
LVL 117
ID: 38767012
if the charts are correct, yes if poorly setup VMs, waiting for resources.

it will be detrimental to the VMs overall performance.

Front End Server for Exchange?
0
 

Author Comment

by:dougdog
ID: 38767014
ok so before i close question
did that spike of 300000 mean 5 min wait?
and what are best metrics to look for to see if more cpu is needed
0
 
LVL 117
ID: 38767026
I would highly recommend, a good read of my EE Article and the Links within

http://communities.vmware.com/docs/DOC-5420

or make it easier for yourself, and install Veeam One for Free.
0
 

Author Comment

by:dougdog
ID: 38767055
still so confused this chart from a slow performing server shows really high cpu ready
it has 2 x vcpus
so the high cpu ready would mean cpu overallocation
but there are high cpu alarms triggered often
how can this be
0
 
LVL 117

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE) earned 500 total points
ID: 38767110
you will always get high cpu triggers, but this does not mean that the VM is started of processes!

however, if your CPU is always at 100% for 24 hours, that's not performing well.

if you have overallocated CPUs to all your VMs, they will all be struggling to get CPU time, on the Cores.

you need to look at the baseline figures, and overall performance.

I would recommend you install Veeam One for FREE.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

758 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

17 Experts available now in Live!

Get 1:1 Help Now