When I use VMware workstation I can set the VM with multiple cores. I am actually using it on a machine with dual core and 4 logical cores. So would I really improve the VMS performance by using more cores on the VM?

  • 3
    It's worth remembering one thing when sizing virtual guests: If it would have benefited the installation on a real machine, then it will benefit it as a virtual machine and vice-versa. And most importantly of all: Nothing magical happens to system or application requirements just because you virtualised something. – Rob Moir Apr 1 '11 at 17:32

it depends on what the VM is running, a guest on a machine with n number of cores will perform best at n-1 cores assigned so long as the guest is capable of utilizing multiple CPUs effectively. Unfortunately the simplest way to determine this is to try it and see. I usually start with 2 and stop when I run out of performance increase. Typically 2 cores is where I see the "sweet spot". Few app/os combinations I've run across will scale better than that.


To clarify, you're saying that you have a dual-core CPU, and you've assigned 4 virtual CPUs on the VM?

In this case, no; if you assign more vCPUs than you have physical execution cores, you will actually see a slight reduction in performance due to the overhead of sharing the 2 physical cores among 4 virtual cores (plus everything running on the physical host).

You will see the best performance from the VM by assigning it 2 vCPUs.

  • Not necessarily - you'll really only see improved performance if the applications running on the VM are able to take advantage of multi-core systems. Unfortunately even though it's 2011, many applications don't. – EEAA Apr 1 '11 at 15:39
  • @ErikA Fair point - application threading aside, I'm just saying that with only 2 physical cores, 2 vCPUs on a single VM is always better than 4 vCPUs. – Shane Madden Apr 1 '11 at 15:50
  • yep, 100% agreed on that point. – EEAA Apr 1 '11 at 15:54

We experimented a while ago (see my question from a year ago) with assigning vCPUs from physical cores vs. logical cores (threads) in quad-core CPUs with hyperthreading (8 assignable vCPUs appeared to be available). As the answers I got back then suggested -- and our experience bore out -- you should allocate the minimum number of cores you can to each guest to allow it to perform.

When assigning more vCPUs than physical cores available on the host, if guests were under simultaneous load hyperthreading wasn't always fast enough at switching the CPU context between threads to effectively simulate another CPU. This can lead to very nasty stuff for all guests, including lockups and timeouts that can require rebooting, fsck, and worse on up the stack. Even if this stuff doesn't happen, performance will often be slower for guests rather than faster.

As @Chris S put it in his comment back then, "always allocate as little as you can get away with and you'll avoid big headaches."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.