Menu="OtherSettings"
Title="CPU Pinning"
Type="xmenu"
Icon="grid.png"
Tag="map-marker"
Tabs="true"
---
$libvirtd = pgrep('libvirtd')!==false;
$dockerd = pgrep('dockerd')!==false;
$cpus = cpu_list();
$total = count($cpus);
$spinner = "
|
";
$cpuset = implode(';',$cpus);
function create() {
// create the table header. Make multiple rows when CPU cores are many ;)
global $total,$cpus;
$loop = floor(($total-1)/32)+1;
$text = [];
for ($c = 0; $c < $loop; $c++) {
$max = ($c == $loop-1 ? ($total%32?:32) : 32);
for ($n = 0; $n < $max; $n++) {
unset($cpu1,$cpu2);
list($cpu1, $cpu2) = preg_split('/[,-]/',$cpus[$c*32+$n]);
$text[$n] .="$cpu1
";
if ($cpu2) $text[$n] .= "$cpu2
";
}
}
$label = implode('
',array_fill(0,$loop,'CPU:'.($cpu2 ? '
HT:':'')));
echo "$label | ".implode(array_map(function($t){return "$t | ";},$text));
}
?>
No CPU pinning available. VM service or Docker service must be started
> This page gives a total view of the current CPU pinning assignments for both VMs and Docker containers.
> It also allows to modify these assignments.
>
> Running VMs or containers are **stopped first** and restarted after the modification.
> Stopped VMs or containers are instantly modified and new assignments become active when the user manually starts the VM or container.
>
> When ***Apply*** is pressed a scan is performed to find the changes, subsequently only VMs or containers which have changes are modified in parallel.
>
> *Important: Please wait until all updates are finished before leaving this page*.
>
> By default NO cores are selected for a Docker container, which means it uses all available cores.
> Do not select **ALL** cores for containers, just select **NO** cores if you want unrestricted core use.