bhyve only using 1 virtual cpu (even though multiple have been assigned)

Status
Not open for further replies.

flahiker76

Cadet
Joined
Jun 9, 2018
Messages
5
I was wondering if anyone has any insight to this specific problem with FreeNAS VM and Bhyve:

I setup a bhyve image of Windows 10 Home for software installation testing and I set the virtual cpus to 8. When I start the image, the cpu registered in windows is 1 and it is always at 100% There are no other processes running in the image.

here is my VM configuration in FreeNas:
  • Virtual CPUS : 8
  • Memory Size : 8196
  • Boot Method : UEFI
  • VM Type : Bhyve
  • devices: NIC (using VirtIO Adapter) | VNC | DISK (Using ZOL in AHCI mode)
Physical configuration:
  • CPU: Dual XEON X5680@3.3mhz (6 cores, 12 threads; westemere EP family) with Virtualization enabled.
  • MEMORY: 72GB
  • FREENAS Version: 11.1.U5
 
Joined
Oct 7, 2016
Messages
29
I was wondering if anyone has any insight to this specific problem with FreeNAS VM and Bhyve:

I setup a bhyve image of Windows 10 Home for software installation testing and I set the virtual cpus to 8. When I start the image, the cpu registered in windows is 1 and it is always at 100% There are no other processes running in the image.

here is my VM configuration in FreeNas:
  • Virtual CPUS : 8
  • Memory Size : 8196
  • Boot Method : UEFI
  • VM Type : Bhyve
  • devices: NIC (using VirtIO Adapter) | VNC | DISK (Using ZOL in AHCI mode)
Physical configuration:
  • CPU: Dual XEON X5680@3.3mhz (6 cores, 12 threads; westemere EP family) with Virtualization enabled.
  • MEMORY: 72GB
  • FREENAS Version: 11.1.U5

Windows 10 Home only supports a single CPU.
Multiple cores but only one CPU.
 

flahiker76

Cadet
Joined
Jun 9, 2018
Messages
5
humn... That is true :)

I will spin up another VM with Windows 10 Pro and Unbuntu to see if I still have the same problem. If not, then lets file this problem away as user error :)
 

ukos

Dabbler
Joined
Jul 22, 2018
Messages
12
@flahiker76 do you have any updates? Did the change to windows 10 professional give more performance?

I have a similar setup with a freenas box having 2 cpus and 2x8 threads each. 32 threads should be more than enough but I can can not get the performance to the windows 10 VM.

If I am assigning more than 2 virtual cpus to the vm in the vm gui interface from freenas, `htop` does not show more than 200% CPU usage and only two randomly chaning threads fully on at 100% at the host.

EDIT:
There is also a tunable:
https://forums.freenas.org/index.ph...rtual-cpu-assignment-issue.58034/#post-409684
 
Last edited:

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
Virtual CPUS : 8
Dual XEON X5680@3.3mhz (6 cores, 12 threads; westemere EP family)
Thats a LOT of vCPUs considering each CPU only has 6 physical cores. This means that if your VM is running on 8 physical cores, your spanning NUMA nodes and this can adversely affect performance. What applications are you running that NEED 8 cores? Ods are that unless you have a hard requirement your performance would be better with fewer cores. I would start with 2 vCPU cores for a desktop VM and only add more if I can show that I NEED it.
 

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457

ukos

Dabbler
Joined
Jul 22, 2018
Messages
12
@flahiker76 sorry to hijack this thread here. I think should have the same issue here.

@kdragon75 since you seem to know a bit, can you elaborate the use of the tunables? I would really like to test performance in my current setup but giving 1 or 2 vcpu is definitely not enogh for my vm when actively working on it.

As I understand it, the constraint is that windows only accepts 2 cpus.
  • Code:
    hw.vmm.topology.cores_per_package
    refers to the number of cores per cpu so this is how to place the vcpus as cores into the 2 available cpus in windows home. If I set it to 8 and I will add 16 vcpus to the vm, then it shows up as 16 virtual processors 2 sockets.
  • Code:
    hw.vmm.topology.threads_per_core
    is the number of threads per core. Obviously. But, as threads are assigned arbitrary by bhyve, this does not necessary reflect a direct mapping of the corresponding threads in the host core if you have a dual core cpu. So setting this to 1 (a Single Core) is probably best but I let the tunable "deactivated" in my current setup.
I'd like to know a bit about the NUMA setup for my dual E5-2670. Do you know how to get the more information from the cpu data sheet for correct numa assignment?

Screenshot from 2018-09-22 16-08-59.png
 
Last edited:

kdragon75

Wizard
Joined
Aug 7, 2016
Messages
2,457
1 or 2 vcpu is definitely not enough for my vm when actively working on it.
Define "actively working on it". In any case you should never allocate more vCPUs than physical cores per CPU -1 and never more memory that any one NUMA node (memory per CPU or half the total in most cases). Especially if you have other VMs running this is important. 8 cores WILL be slower than 6 or preferably 4-5.
correct numa assignment?
This is all automatic by the kernel and hypervisor. It is possible to pin a process to a CPU/core/NUMA node but that's not recommended or supported in FreeNAS bhyve. Just let the schedulers do their thing.

For further discussion, please start your own thread.
 
Status
Not open for further replies.
Top