Performance in a vm

This is rather useful. Your command is slightly different that the one I’d use since you only create 1 cpuset for the host cores - I assume there is only a point to create another one if you have more than 1 VMs running and you’d like different rules for different cpusets.

Why taskset the PID 2 ? Unless I misunderstood this :face_with_monocle:

1 Like

The idea here is to shield the VMs from the host. vfio-isolate takes all the userspace threads and puts them into the defined cpuset, then the taskset command takes the kernel threads, called kthreadd, that vfio-isolate can’t move and restricts them to the cpuset too.
VMs can run outside of this cpuset, meaning uninterrupted by whatever the host does. To see this working in action run sudo stress --cpu 32 on your machine and start a VM. You will be able to see how the entire load of the host will be limited to the host cpuset defined.

I want to point out you can still put different VMs on the cores that the host can’t use, if you don’t pin their cores they can still interfere with each other. But the host can’t interfere with the VMs.

1 Like

Your in need of a hypervisor that does not run an Desktop-OS and only runs the VM’s below it.

/coff covid-19 ZEN

@Ur4m3sh1 any updates on this one?
Did you manage to improve CPU performance to a noticeable point?
If yes, can you please post your configuration and startup scripts?