Skip to content

Commit

Permalink
doc: Update CPU pinning documentation for containers
Browse files Browse the repository at this point in the history
Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani committed Oct 3, 2024
1 parent 94ba016 commit 3c071ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions doc/reference/instance_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ You have different options to limit CPU usage:
This option is available only for containers.
See {ref}`instance-options-limits-cpu-container` for how to set this option.
- Set {config:option}`instance-resource-limits:limits.cpu.pin_strategy` to specify the strategy for virtual-machine CPU auto pinning.
This option is available only for virtual machines.
See {ref}`instance-options-limits-cpu-vm` for how to set this option.
See {ref}`instance-options-limits-cpu` for how to set this option.

It is possible to set both options at the same time to restrict both which CPUs are visible to the instance and the allowed usage of those instances.
However, if you use {config:option}`instance-resource-limits:limits.cpu.allowance` with a time limit, you should avoid using {config:option}`instance-resource-limits:limits.cpu` in addition, because that puts a lot of constraints on the scheduler and might lead to less efficient allocations.
Expand All @@ -117,7 +116,7 @@ You can specify either which CPUs or how many CPUs are visible and available to

To pin to a single CPU, use the range syntax (for example, `1-1`) to differentiate it from a number of CPUs.
- If you specify a number (for example, `4`) of CPUs, LXD will do dynamic load-balancing of all instances that aren't pinned to specific CPUs, trying to spread the load on the machine.
Instances are re-balanced every time an instance starts or stops, as well as whenever a CPU is added to the system.
When `instance-resource-limits:limits.cpu.pin_strategy` is set to `auto`, instances are re-balanced every time an instance starts or stops, as well as whenever a CPU is added to the system.

(instance-options-limits-cpu-vm)=
##### CPU limits for virtual machines
Expand Down

0 comments on commit 3c071ad

Please sign in to comment.