@@ -85,8 +85,8 @@ CPU 管理策略通过 kubelet 参数 `--cpu-manager-policy`
85
85
The CPU manager periodically writes resource updates through the CRI in
86
86
order to reconcile in-memory CPU assignments with cgroupfs. The reconcile
87
87
frequency is set through a new Kubelet configuration value
88
- `-cpu-manager-reconcile-period`. If not specified, it defaults to the same
89
- duration as `-node-status-update-frequency`.
88
+ `-- cpu-manager-reconcile-period`. If not specified, it defaults to the same
89
+ duration as `-- node-status-update-frequency`.
90
90
-->
91
91
CPU 管理器定期通过 CRI 写入资源更新,以保证内存中 CPU 分配与 cgroupfs 一致。
92
92
同步频率通过新增的 Kubelet 配置参数 ` --cpu-manager-reconcile-period ` 来设置。
@@ -233,7 +233,7 @@ exclusive CPUs.
233
233
234
234
<!--
235
235
The kubelet requires a CPU reservation greater than zero be made
236
- using either `--kube-reserved` and/or `--system-reserved` or `--reserved-cpus` when the static
236
+ using either `--kube-reserved` and/or `--system-reserved` or `--reserved-cpus` when the static
237
237
policy is enabled. This is because zero CPU reservation would allow the shared
238
238
pool to become empty.
239
239
--->
@@ -397,6 +397,7 @@ You will still have to enable each option using the `CPUManagerPolicyOptions` ku
397
397
The following policy options exist for the static `CPUManager` policy :
398
398
* `full-pcpus-only` (beta, visible by default)
399
399
* `distribute-cpus-across-numa` (alpha, hidden by default)
400
+ * `align-by-socket` (alpha, hidden by default)
400
401
-->
401
402
# ### Static 策略选项
402
403
@@ -408,6 +409,7 @@ The following policy options exist for the static `CPUManager` policy:
408
409
静态 `CPUManager` 策略存在以下策略选项:
409
410
* `full-pcpus-only`(beta,默认可见)
410
411
* `distribute-cpus-across-numa`(alpha,默认隐藏)
412
+ * `align-by-socket`(alpha,默认隐藏)
411
413
412
414
<!--
413
415
If the `full-pcpus-only` policy option is specified, the static policy will always allocate full physical cores.
@@ -456,6 +458,26 @@ static 策略会在 NUMA 节点上平均分配 CPU。
456
458
应用程序开发人员可以更轻松地确保没有某个工作线程单独受到 NUMA 影响,
457
459
从而提高这些类型应用程序的整体性能。
458
460
461
+ <!--
462
+ If the `align-by-socket` policy option is specified, CPUs will be considered
463
+ aligned at the socket boundary when deciding how to allocate CPUs to a
464
+ container. By default, the `CPUManager` aligns CPU allocations at the NUMA
465
+ boundary, which could result in performance degradation if CPUs need to be
466
+ pulled from more than one NUMA node to satisfy the allocation. Although it
467
+ tries to ensure that all CPUs are allocated from the _minimum_ number of NUMA
468
+ nodes, there is no guarantee that those NUMA nodes will be on the same socket.
469
+ By directing the `CPUManager` to explicitly align CPUs at the socket boundary
470
+ rather than the NUMA boundary, we are able to avoid such issues. Note, this
471
+ policy option is not compatible with `TopologyManager` `single-numa-node`
472
+ policy and does not apply to hardware where the number of sockets is greater
473
+ than number of NUMA nodes.
474
+ -->
475
+ 如果指定了 `align-by-socket` 策略选项,那么在决定如何分配 CPU 给容器时,CPU 将被视为在 CPU 的插槽边界对齐。
476
+ 默认情况下,`CPUManager` 在 NUMA 边界对齐 CPU 分配,如果需要从多个 NUMA 节点提取出 CPU 以满足分配,将可能会导致系统性能下降。
477
+ 尽管 `align-by-socket` 策略试图确保从 NUMA 节点的**最小**数量分配所有 CPU,但不能保证这些 NUMA 节点将位于同一个 CPU 的插槽上。
478
+ 通过指示 `CPUManager` 在 CPU 的插槽边界而不是 NUMA 边界显式对齐 CPU,我们能够避免此类问题。
479
+ 注意,此策略选项不兼容 `TopologyManager` 与 `single-numa-node` 策略,并且不适用于 CPU 的插槽数量大于 NUMA 节点数量的硬件。
480
+
459
481
<!--
460
482
The `full-pcpus-only` option can be enabled by adding `full-pcups-only=true` to
461
483
the CPUManager policy options.
@@ -464,9 +486,13 @@ Likewise, the `distribute-cpus-across-numa` option can be enabled by adding
464
486
When both are set, they are "additive" in the sense that CPUs will be
465
487
distributed across NUMA nodes in chunks of full-pcpus rather than individual
466
488
cores.
489
+ The `align-by-socket` policy option can be enabled by adding `align-by-socket=true`
490
+ to the `CPUManager` policy options. It is also additive to the `full-pcpus-only`
491
+ and `distribute-cpus-across-numa` policy options.
467
492
-->
468
493
可以通过将 `full-pcups-only=true` 添加到 CPUManager 策略选项来启用 `full-pcpus-only` 选项。
469
- 同样地,可以通过将 `distribute-cpus-across-numa=true`
470
- 添加到 CPUManager 策略选项来启用 `distribute-cpus-across-numa` 选项。
471
- 当两者都设置时,它们是“累加的”,因为 CPU 将分布在 NUMA 节点的 full-pcpus 块中,
472
- 而不是单个核心。
494
+ 同样地,可以通过将 `distribute-cpus-across-numa=true` 添加到 CPUManager 策略选项来启用 `distribute-cpus-across-numa` 选项。
495
+ 当两者都设置时,它们是“累加的”,因为 CPU 将分布在 NUMA 节点的 full-pcpus 块中,而不是单个核心。
496
+ 可以通过将 `align-by-socket=true` 添加到 `CPUManager` 策略选项来启用 `align-by-socket` 策略选项。
497
+ 同样,也能够将 `distribute-cpus-across-numa=true` 添加到 `full-pcpus-only`
498
+ 和 `distribute-cpus-across-numa` 策略选项中。
0 commit comments