VirtualBox – How Many Processors to Configure on Quad Core Host with Hyper-Threading

cpuhyper-threadingvirtual machinevirtualbox

I have a quad-core i7 processor with hyperthreading (8 logical cores), when I configured a virtual machine to use 8 processors, VirtualBox gave me a warning saying that I only have four cores (which is true) and that this may cause a performance issue. But hyper-threading is a hardware feature, so the OS sees 8 cores and it sends instructions to all 8. What if setting it to 4 caused the VM to use 2 cores (4 threads) instead of 4 simultaneous threads (on all 4 cores)? Does the warning I got take into account that my machine has hyper-threading?

Best Answer

Based on the benchmark done by Kristian Wedberg I would say you should use all logical cores you have.
Also I did my own benchmark using same CPU (i7, 4 CPU with HT) which confirmed performance boost for multi-threaded applications. If guest PC (Win. 8.1 x64) used all 8 cores, then host PC (Ubuntu x64) also used all 8 cores.

enter image description here

I compared also performance in single-threaded applications. In both cases I measured same values so there is no penalty using more than physical (but up to logical) number of CPUs.
Here you can see that 1 CPU full load in guest PC will result to 1 CPU load in host PC.

enter image description here

Related Question