VMware Cloud Community
fontyyy
Contributor
Contributor
Jump to solution

vCPUs?

Hi there

Any thoughts on the number of vCPU's it's considered ideal to give a server?

Is a 4 vCPU "machine" faster than a 1 or 2 vCPU in all situations or indeed any situations?

My ESX servers are 3.0.1, hosts are Dell 1850's with dual Xeons around the 3ghz mark, currently running 2 or 3 v-servers per host but that will rise as needs do and when some more memory arrives.

The reason I ask is I've just set up from scratch a server for a project and gave it 4 vCPU's without thought, then I converted a Microsoft VM (with obviously has 1 vcpu as that's all they can do) and there's no need to benchmark it, the ex-Microsoft VM (dispite the fact it's running MOM, and yes I know running MOM on a VM is not recommended) is visably a lot faster that the 4 vCPU install of nothing but Server 03.

So, what's ideal, will (for example) a 4 vCPU sit there doing nothing waiting for 4 cores to be free as was suggested here[/url]?

Thanks

Reply
0 Kudos
1 Solution

Accepted Solutions
davidbarclay
Virtuoso
Virtuoso
Jump to solution

the only thing to consider for the very poor score for the 4 vCPU machine

That might not be the only reason. Stay away from assigning as many vCPUs as there are physical cores. You limit the possible combinations for instruction execution. This can lead to a performance degradation. See my previous post for details.

Of course, all environments/needs are different - make your own educated decision. I tend to start with a single vCPU, then monitor/assess/implement changes as necessary.

Dave

View solution in original post

Reply
0 Kudos
10 Replies
conyards
Expert
Expert
Jump to solution

I'd bet that this is the case, the 4 vCPU machine will need to schedule time on four logical cores in order to run threads.

You could identify if this is the case by monitoring the %ready time of the 4 way VM.

https://virtual-simon.co.uk/
Reply
0 Kudos
stvkpln
Virtuoso
Virtuoso
Jump to solution

The rule of thumb we use in our environment(s) is to use only 1 vCPU unless there's concrete requirement and the applicatoin will actually be able to take advantage of multiple CPU's. The major problem you'll run into with vCPU's is that the vmkernel requires access to N physical cpu's and/ore cores (where N is the number of vCPU's assigned to the VM) to execute anything for that VM, so if you're using a 4 vCPU VM.. it will require being able to access all 4 cores on your Dell server in order to work, as opposed to the 1 vCPU VM that only requires 1. Less, in many cases, is more.

-Steve
kix1979
Immortal
Immortal
Jump to solution

The only time 4 vCPUs will be faster is if there is no contention for resources and the application/OS can handle the multiple threads, so apps like Exchange or SQL.

Thomas H. Bryant III
Reply
0 Kudos
MR-T
Immortal
Immortal
Jump to solution

Don't bother with 4 vcpu's.

Unless you've got an 8-way box without anything else running and you're application is multi threaded, you're so much better off with single vcpu's.

The contention you'll see whilst trying to schedule a 4 vcpu virtual machine isn't worth it. Also don't forget to factor in the service console, that needs CPU time.

Reply
0 Kudos
fontyyy
Contributor
Contributor
Jump to solution

So this is what I've found with CPUMark 2.1[/url];

4 vCPU instalation of Server 2003 r2, nothing else on the system, host is twin 3ghz host dell 1850

overall score 2778

2 vCPU instalation of Server 2003 r2, SQL 2005, host is twin 3.2 ghz Dell 1850

overall score 3681

1 vCPU instalation of Server 2003 r2, MOM, host is twin 3.2 ghz Dell 1850

overall score 3715

1 CPU native Windows instalation on single 2.8 ghz Dell 1850, this is the Virtual Centre machine

overall score 3257

the only thing to consider for the very poor score for the 4 vCPU machine is that it is on a host running a very busy machine as well.

Hardly defintative, but seems to go with what's being said here quite well.

Question 2 is will I kill a VM by reducing the number of vCPU's?

Reply
0 Kudos
davidbarclay
Virtuoso
Virtuoso
Jump to solution

The VMWare Tips and Tricks whitepaper has a few paragraphs on CPUs and how instructions are executed.

See "The Math behind Virtual SMP Scheduling" on page 4.

http://www.vmware.com/pdf/tips_tricks_infrastructure_services.pdf

Start with a single vCPU, monitor performance and then make educated decisions.

Dave

davidbarclay
Virtuoso
Virtuoso
Jump to solution

the only thing to consider for the very poor score for the 4 vCPU machine

That might not be the only reason. Stay away from assigning as many vCPUs as there are physical cores. You limit the possible combinations for instruction execution. This can lead to a performance degradation. See my previous post for details.

Of course, all environments/needs are different - make your own educated decision. I tend to start with a single vCPU, then monitor/assess/implement changes as necessary.

Dave

Reply
0 Kudos
fontyyy
Contributor
Contributor
Jump to solution

"Stay away from assigning as many vCPUs as there are physical cores. You limit the possible combinations for instruction execution."

This seems to be the thing from reading around and as mentioned I suppose if the application is not optimised for multiple processors it's a bit of a waste anyway.

Reply
0 Kudos
davidbarclay
Virtuoso
Virtuoso
Jump to solution

This seems to be the thing from reading around and as mentioned I suppose

if the application is not optimised for multiple processors it's a bit of a waste

anyway.

My comments were over and above the application's ability to multi-thread.... ALWAYS 1 vcpu unless you have magical CSI-type skills to predetermine the outcome!

If, and only if you have an app that WILL take the benefit of the vcpu...then try/test/deploy.

Dave

Reply
0 Kudos
fontyyy
Contributor
Contributor
Jump to solution

The server I mentioned doing a lot is a terminal server used by staff and students for working from home, halls of residence etc. it usually has somewhere between 10 and 30 terminal sessions running anything from Outlook and Word to VS2003.

This was 4 vCPU's, I snapshoted it just in case and changed it to 2 vCPUs late last night, it's defintately no slower and maybe quicker.

Interesting indeed...

Reply
0 Kudos