VirtualBox

Opened 4 years ago

Last modified 3 years ago

#20158 new defect

VirtualBox falsely claims that using hyperthreaded cores is an "invalid setting"

Reported by: Aren Cambre Owned by:
Component: other Version: VirtualBox 6.1.18
Keywords: Cc:
Guest type: other Host type: other

Description

Intel CPUs often have x physical cores and 2x hyper-threaded cores. From the view of applications running on the bare metal OS, the system typically has 2x cores.

If I am configuring a VM guest in VirtualBox, and on the System > Processor tab I select more than x cores for the Processor(s) slider, an Invalid settings detected notice appears on the bottom. Clicking on the adjacent icon reveals a terse warning that exceeding x cores is "likely to degrade performance of your virtual machine".

This seems false:

  • Intel generally intends that you act as if your CPU has 2x cores. With this, hyper-threading helps the chip increase performance.
  • In https://unix.stackexchange.com/a/325959, a person conducted a few raw-performance tests on VMs with x and 2x cores. The finding was that giving the guest OS 2x cores caused significant performance gains.

Unless there is convincing evidence that giving a guest OS more than x cores is harmful, then it should not be assumed that there is any benefit to limiting guest core use to x cores. The warning for exceeding x cores should go away, and the slider should not be themed red at the point where you exceed x.

Change History (3)

comment:1 by Aren Cambre, 4 years ago

I probably should add some nuance to this (I would edit my original submission, but the poor configuration of this bug tracker doesn't permit that).

It could be possible that there is a point between x and 2x CPUs where performance could degrade in certain ways. I could understand if the host needs some reserve CPU capacity to deal with the guest properly. It beggars belief that one falls off a cliff as soon as x is exceeded, though. If it is true that this point exists and it's more than x and it's uncertain, then the warning should not be as stark.

comment:2 by Aren Cambre, 4 years ago

I just did an informal test. I have an i7-1185G7. I used 7-Zip to compress 0.99 GB of text log files. All settings were default except I made sure the number of threads allowed matched the number of cores provided to the guest OS.

It took:

  • 1:34 with 4 cores/4 threads, host CPU utilization hovered around 50%
  • 1:13 with 6 cores/6 threads, host CPU utilization hovered around 50%
  • 0:58 with 8 cores/8 threads, host CPU utilization hovered around 60%

Also, the guest OS feels far snappier when it gets 6-8 cores. It is laggy with 4 cores.

comment:3 by aim, 3 years ago

Probably the recommendation should be expanded as follows https://unix.stackexchange.com/a/443174

Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette