Isolating CPU cores for Virtual Machines
When you’re running VMs you don’t want your host scheduler to schedule processes onto the CPU cores that are being used for the VMs.
Fortunately, there’s a very nice kernel parameter isolcpus
which can be used to achieve this.
For example, consider my machine which has 128 vCPUs - from 0 till 127.
I can use isolcpus=8-127
to ensure that the host OS only uses CPUs 0-7
for the host’s processes and reserve CPUs 8-127
.
Ofcourse, you need to explicitly tell libvirt to use the specific CPUs for your VMs using vcpupin
etc.
Check out my NUMA tuning guide for instructions here.