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

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

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
dougdog
Asked:
dougdog
  • 13
  • 12
1 Solution
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
dougdogAuthor Commented:
this is from esxtop on 1 of my hosts
esxtop.PNG
0
Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
see here on the charts

CPU Ready
0
 
dougdogAuthor Commented:
did you open the attachments i sent
does this indicate high cpu ready
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
dougdogAuthor Commented:
ok so ready and costop are used to monitor cpu over allocation
what are best indicators to monitor cpu under allocation
0
 
dougdogAuthor Commented:
also on my chart sometimes it spikes to 300000milseconds does this mean sometimes a wait time of 5 min
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
your chart is very high, are all your VMs like this?

reduce cpus on a VM.
0
 
dougdogAuthor Commented:
so does that mean the machine was waiting for a minute to get resources or is that incorrect
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
i have around 16 vms running on each esx server
the esx server has 2 quad core cpus
0
 
dougdogAuthor Commented:
even worse on that chart sometimes it spiked to 300000 surely that cant mean waiting nearly 5 min for resources

can it???
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
that should be fine, unless you give ALL your VMs,

4 vCPUs!

reduce vCPUs!
0
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
 
dougdogAuthor Commented:
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
 
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
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
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

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

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