VM - CPU/core assignment

RaphM123

Cadet
Joined
Sep 20, 2018
Messages
6
I'll soon be upgrading the hardware of my scale server, amongst others things with a new Xeon D-1718T. It has 4 cores/8 threads with reasonable speed at only 46W TDP (as with many others, power consumption is a big point for me these days).

I'll be using a single VM providing services like Nextcloud, a git server, jellyfin etc... - so the main CPU burden is on that VM and not on the base TrueNAS system, which will only provide file shares and host that VM. (single user, no dedup etc.)

I was wondering what the best practice for CPU/core assignment would be in such a scenario -

* Just pass in 4 cores / 2 threads per core so the VM can utilize the full CPU under full load conditions?
* Reserve some cores for the TrueNAS host, e.g. only pass 3 cores / 2 t.p.c. to the VM

My reasoning is that I don't want the host to become completely "CPU deprived" when the VM is under full load.

I'm mainly asking because I'm not sure how qemu handles situations where all cores are assigned to VMs are under full load - will it maybe keep some kind of buffer for the host even in the first scenario?
(What I evidently know is that if you assign say 6 cores of an 8 core system to a VM and bring that VM under full load, the host will have all 8 cores at about 75% load instead of the maybe expected 6 cores at 100% and 2 cores at near idle - so there is definitely some smartness built into qemus CPU scheduling)
 
Top