How many virtual processors or cores should I assign to my Guest OS?

8

1

I've just received an upgraded Host machine, and am looking to push some of those advances to my workstations Guest OS(s). In particular, I used to have a single processor, with 2 cores, so my Guest OS only had 1/1.

Now, I've got a single processor with 8 cores, so I'm curious about what would be recommended for my Guest OS now?

  • 1 processor/4 cores?
  • 2 processors/2 cores?
  • 4 processors/1 core?

My instinct says to stick with the number of physical processors (or less), but, is that based on reality? I spent a good while looking for an answer to this, but perhaps my google-karma isn't in my favor today.

reidLinden

Posted 2011-02-14T14:50:22.547

Reputation: 181

Question was closed 2018-12-12T15:58:22.457

Is your guest using up the processing capabilities it has as it is now? – OldWolf – 2011-09-08T20:54:10.600

This link may be helpful, suggesting that you match your configuration to the host's NUMA configuration.

– Glenn – 2013-11-09T00:26:48.223

Answers

3

In my own testing, with VMWare Workstation, using latest GeekBench 3, 64-bit tests, on a host machine with 1 cpu, 2 cores (with HT turned on, so 4 cores):

Host System:

  • 2866 Single Core Score, 5939 Multi-Core Score

Virtualized:

  • 1 cpu, 1 core: 2783 sc, 2705 mc
  • 1 cpu, 2 cores: 2758 sc, 4271 mc
  • 1 cpu, 3 cores: 2783 sc, 5234 mc
  • 1 cpu, 4 cores: 2769 sc, 5793 mc

So, at least in my testing, it looks like there's a benefit to setting your virtual number of cores to match your physical cores. Maybe I'm wrong. I'd love to discuss.

Nicholas

Posted 2011-02-14T14:50:22.547

Reputation: 608

Excellent research! Thanks. Could you extend this research to cover some of the other options I highlighted in the original post? Like a virtual 2/2 and 4/1 system (having already identified that a 1/4 out performs 1/4- setups)? That's the real question. Should you go 1/4, 2/2, or 4/1 (assuming you're going with 4 virtual cores overall). Also, I'll admit that I don't understand the difference in "single core score" and "multi-core score" in each of your examples. How can a 1cpu/1core machine get a multi-core score at all? Same for the 1cpu/4core situation, in reverse.... – reidLinden – 2014-01-09T14:01:23.207

2

I don't know if this information is still valid, but in the not-too-long-ago past, additional guest CPUs didn't scale nearly as well as host CPUs did. In fact, best recommendation was to stay with single CPUs in your guest configurations unless you were specifically testing/debugging multithreaded software in your guests and required an SMP environment.

Edit: This answer is particular to desktop virtualization, not server virtualization.

afrazier

Posted 2011-02-14T14:50:22.547

Reputation: 21 316

so, you're saying 1 processor, with a single core? – reidLinden – 2011-02-14T16:26:10.720

Yes. Does VMware workstation allow for setting those values independently now? I haven't used it since ver 6, and it was just a # of CPUs. If you're going to do multi-core/multi-CPUs in your guests, I doubt it much matters which way you scale things unless licensing considerations (# of "sockets" vs. # of "cores") come into play. e.g. XP Home only allows 1 socket, but up to 4 cores, while XP Pro allows for 2 sockets. – afrazier – 2011-02-14T16:50:23.337

yea, I appear to have the option to pick "# processors" and "# cores" independently... My Host machine has 1 processor with 8 cores, on a windows7 Professional, and my (main) guestOS is a windows server 2003... – reidLinden – 2011-02-14T17:07:57.690

0

There is little difference at this point. In some cases software licensing may depend on cores or CPUs.

Virtualized: 1 cpu, 1 core: 2783 sc, 2705 mc 1 cpu, 2 cores: 2758 sc, 4271 mc 1 cpu, 3 cores: 2783 sc, 5234 mc 1 cpu, 4 cores: 2769 sc, 5793 mc So, at least in my testing, it looks like there's a benefit to setting your virtual number of cores to match your physical cores. Maybe I'm wrong. I'd love to discuss.

This is only in a benchmark that uses all cores. Most applications don't scale performance linearly with core count as they just don't use the extra cores.

There is also some level of overhead with adding more cores. Therefor in short, only add the number of cores your application needs to perform at the levels you need. Just because you have 4 cores in your host does not mean every VM should get 4 cores.

In a number of the environments that I manage we have dual 10 core CPUs with a total of 40 logical threads and my domain controllers still only get two cores.

Curtis

Posted 2011-02-14T14:50:22.547

Reputation: 1

0

At most I give my guest OS 2 cores. It doesn't matter if you do 1 processor 2 cores or 2 processor 1 core each. The procesor setting is for compatibility reasons. Processor/cores don't scale so well for guest OS because of core/processor process scheduling. 2 cores seems to be the sweet spot.

Metril

Posted 2011-02-14T14:50:22.547

Reputation: 411

You want to avoid having one processor and one core for a VM because if any operation that the host OS doesn't expect to block blocks unexpectedly in the host, the entire VM is blocked. – David Schwartz – 2013-11-09T00:45:11.897

-2

I am quite shocked that these frequently asked questions have not been fully answered by now. Your host CPU should support some virtualization technologies, e. g. the Intel VTx. That allows you to "tunnel" the whole power of the CPU into your guest operating system. Otherwise, there will be an enormous speed drop due to the emulation of a CPU. If you're having a CPU with hyperthreading, you should see 8 processors for a quad-core CPU in the device manager of your host machine (hyperthreading doubles the number of your cores). In that case, you can assign 1 processor with 4 cores for your guest os. As long as you don't have any other physical processor in your system, do not assign more than 1 processor to your virtual machine. You can assign more or fewer cores to your guest os, depending on your needs, but you shouldn't assign a value higher than your hyperthreading cores. But note, that your host also needs some CPU power. I usually set up the half number of my hyperthreading cores and the half number of my memory, e. g. 8192 MB when you have 16 Gig of RAM. This is usually a good setting to go, but not if you want to run more than one virtual machine at a time.

martinjohannes93

Posted 2011-02-14T14:50:22.547

Reputation: 1