What is the max CPUs on a multi-socket machine?

This is for discussing general topics about how to use VirtualBox.
Post Reply
marius311
Posts: 3
Joined: 26. Jul 2018, 13:07

What is the max CPUs on a multi-socket machine?

Post by marius311 »

Hi, the documentation states:
You should not, however, configure virtual machines to use more CPU cores than you have available physically (real cores, no hyperthreads).
Do the number of sockets a machine has impact this rule? Specifically, on a machine with CPUs on multiple sockets, should the max number configured be the total number of physical cores across all sockets, or the number of physical cores on just a single socket?

Thanks.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: What is the max CPUs on a multi-socket machine?

Post by mpack »

If you want to know how many physical cores VirtualBox thinks are available, look at any VM log and search for the phrase "host cores".
marius311
Posts: 3
Joined: 26. Jul 2018, 13:07

Re: What is the max CPUs on a multi-socket machine?

Post by marius311 »

Thanks for the quick reply. So is it correct to say that the "host cores" is the correct max number of CPUs to run with on any given system?

To give you more info, I'm asking about this in the context of BOINC volunteer computing where we run computations on volunteer's computers via Virtualbox (and thus its not particularly easy for us to check what works on any given system; often if a job fails we may not get a second chance on that particular host because the user uninstalled BOINC).
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: What is the max CPUs on a multi-socket machine?

Post by mpack »

Host cores is the sum of the cores across all sockets which represents the maximum number of cores available on the PC. You should not assign all of them to the VM however - the host OS needs CPU time to run host apps, particularly VirtualBox!

You also need to be sure that the cores assigned to the VM will actually be used, because a VM has a switching overhead associated with each core which applies whether or not the core is used, so if it isn't being used then it's purely overhead, meaning that the VM gets slower.
marius311
Posts: 3
Joined: 26. Jul 2018, 13:07

Re: What is the max CPUs on a multi-socket machine?

Post by marius311 »

Thanks again. One last question as we're sorting this out (btw, if its of any interest to you, you could follow along at https://github.com/BOINC/boinc/pull/2624).

No single running VM should exceed the number of physical cores, but is it OK to run eg two VMs in parallel, each of which is assigned a number of cores corresponding to the number of physical cores on the host? If this is possible, are there performance implications, e.g. could this end up being slower than if we ran the computation performed by each of the VMs sequentially?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: What is the max CPUs on a multi-socket machine?

Post by mpack »

It depends what you mean by "ok". If you try to allocate >= 100% of available CPU to any combination of tasks on your PC then it may have difficulty performing smoothly, but it shouldn't crash. The fact that one or more of the host tasks is implementing a VM doesn't change the basic arithmetic.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: What is the max CPUs on a multi-socket machine?

Post by socratis »

Remember that simple rule:
  • Total CPUs for all your guests + 1 Host CPUs. The host needs at least 1 core to do the resource management effectively.
  • Total RAM+vRAM+overhead for all your guests Host available RAM + some.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply