Link to home
Start Free TrialLog in
Avatar of dougdog
dougdog

asked on

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
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

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.
Avatar of dougdog
dougdog

ASKER

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
Avatar of dougdog

ASKER

this is from esxtop on 1 of my hosts
esxtop.PNG
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?
Avatar of dougdog

ASKER

its a front end server running iis
min max readings ?
are thesew in the screenshots attached or do i need to look somewhere else
Avatar of dougdog

ASKER

did you open the attachments i sent
does this indicate high cpu ready
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.
Avatar of dougdog

ASKER

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
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.
Avatar of dougdog

ASKER

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
Avatar of dougdog

ASKER

ok so ready and costop are used to monitor cpu over allocation
what are best indicators to monitor cpu under allocation
Avatar of dougdog

ASKER

also on my chart sometimes it spikes to 300000milseconds does this mean sometimes a wait time of 5 min
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
your chart is very high, are all your VMs like this?

reduce cpus on a VM.
Avatar of dougdog

ASKER

so does that mean the machine was waiting for a minute to get resources or is that incorrect
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.
Avatar of dougdog

ASKER

i have around 16 vms running on each esx server
the esx server has 2 quad core cpus
Avatar of dougdog

ASKER

even worse on that chart sometimes it spiked to 300000 surely that cant mean waiting nearly 5 min for resources

can it???
that should be fine, unless you give ALL your VMs,

4 vCPUs!

reduce vCPUs!
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?
Avatar of dougdog

ASKER

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
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.
Avatar of dougdog

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Andrew Hancock (VMware vExpert PRO / EE Fellow/British Beekeeper)
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial