Skip to content

Commit 8d76234

Browse files
committed
Add more steps to enable the feature
1 parent b2791f3 commit 8d76234

File tree

1 file changed

+2
-3
lines changed
  • content/en/blog/_posts/2024-08-22-cpumanager-static-policy-distributed-cpu-across-cores

1 file changed

+2
-3
lines changed

content/en/blog/_posts/2024-08-22-cpumanager-static-policy-distributed-cpu-across-cores/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ In Kubernetes v1.31, we are excited to introduce a significant enhancement to CP
1111

1212
## Understanding the feature
1313

14-
1514
Traditionally, Kubernetes' CPUManager tends to allocate CPUs as compactly as possible, typically packing them onto the fewest number of physical cores. However, allocation strategy matters, CPUs on the same physical host still share some resources of the physical core, such as the cache and execution units, etc.
1615

1716
{{< figure src="cpu-cache-architecture.png" alt="cpu-cache-architecture" >}}
@@ -20,14 +19,14 @@ While default approach minimizes inter-core communication and can be beneficial
2019

2120
The new `distribute-cpus-across-cores` feature addresses this issue by modifying the allocation strategy. When enabled, this policy option instructs the CPUManager to spread out the CPUs (hardware threads) across as many physical cores as possible. This distribution is designed to minimize contention among CPUs sharing the same physical core, potentially enhancing the performance of applications by providing them dedicated core resources.
2221

23-
2422
Technically, within this static policy, the free CPU list is reordered in the manner depicted in the diagram, aiming to allocate CPUs from separate physical cores.
2523

2624
{{< figure src="cpu-ordering.png" alt="cpu-ordering" >}}
2725

2826

2927
## Enabling the feature
30-
To enable this feature, users can add `distribute-cpus-across-cores=true` to their CPUManager policy options in the Kubernetes configuration. This setting directs the CPUManager to adopt the new distribution strategy. It is important to note that this policy option cannot currently be used in conjunction with `full-pcpus-only` or `distribute-cpus-across-numa` options.
28+
29+
To enable this feature, users firstly need to add `--cpu-manager-policy=static` kubelet flag or the `cpuManagerPolicy: static` field in KubeletConfiuration. Then user can add `--cpu-manager-policy-options distribute-cpus-across-cores=true` or `distribute-cpus-across-cores=true` to their CPUManager policy options in the Kubernetes configuration or. This setting directs the CPUManager to adopt the new distribution strategy. It is important to note that this policy option cannot currently be used in conjunction with `full-pcpus-only` or `distribute-cpus-across-numa` options.
3130

3231

3332
## Current limitations and future directions

0 commit comments

Comments
 (0)