Page 1 of 1
Using all cores to 100% on host
Posted: 13. Apr 2020, 18:27
by geohei
Hi.
I'm presently working on a test project with VirtualBox.
Host: Windows 10 on i9900 CPU
Guest : Ubuntu 18.04 server
VB: 6.0.14
I compiled some code using the POSIX multithread libraries (pthread.h).
When using 16 threads, I get around 62% CPU load on the host side.
For testing, I recompiled using 8 and 32 threads.
More or less the same result.
The host CPU load varies between 55% and 63%.
Is that normal?
Re: Using all cores to 100% on host
Posted: 13. Apr 2020, 18:49
by Martin
You have a CPU with 8 cores.
The hosts needs a free core for itself to run a VM efficiently.
So in most cases you would see best guest performance with less than 8 virtual CPUs in the guest on this system.
Threds don't count for virualization in almost all cases.
Re: Using all cores to 100% on host
Posted: 13. Apr 2020, 23:51
by scottgus1
also, the more cores you put in a guest the slower it will run, due to extra scheduling commands needed on the host to put the guest commands through the CPU cores. A modern OS is happy with two cores, and more will make it sluggish unless there are other multi-threaded programs running in it that need more cores.
Re: Using all cores to 100% on host
Posted: 14. Apr 2020, 08:31
by geohei
Thanks a lot for the answers.
Martin wrote:You have a CPU with 8 cores.
The hosts needs a free core for itself to run a VM efficiently.
So in most cases you would see best guest performance with less than 8 virtual CPUs in the guest on this system.
Threds don't count for virualization in almost all cases.
For testing purpose, I reduced from 8 to 7 cores.
Performance dropped from 63% to 51%.
scottgus1 wrote:also, the more cores you put in a guest the slower it will run, due to extra scheduling commands needed on the host to put the guest commands through the CPU cores. A modern OS is happy with two cores, and more will make it sluggish unless there are other multi-threaded programs running in it that need more cores.
That's what I noticed as well (2 cores are best), but only for single-thread binaries. Mine is however multi-thread and uses all cores.