Please enable Javascript to view the contents

 ·  ☕ 1 分钟

How Does the CPU Manager Work?

When CPU manager is enabled with the “static” policy, it manages a shared pool of CPUs. Initially this shared pool contains all the CPUs in the compute node. When a container with integer CPU request in a Guaranteed pod is created by the Kubelet, CPUs for that container are removed from the shared pool and assigned exclusively for the lifetime of the container. Other containers are migrated off these exclusively allocated CPUs.

All non-exclusive-CPU containers (Burstable, BestEffort and Guaranteed with non-integer CPU) run on the CPUs remaining in the shared pool. When a container with exclusive CPUs terminates, its CPUs are added back to the shared CPU pool.
More Details Please …

hyper-thread and physical core assign

https://builders.intel.com/docs/networkbuilders/cpu-pin-and-isolation-in-kubernetes-app-note.pdf

2.2 CPU Manager (in native K8s) : One CPU core in K8s* is equivalent to 1 hyper-thread on an Intel® Hyper-Threading (HT) Technology system. If two CPU cores are requested by a container, the CPU manager will assign both hyper-threads from a single physical core.

Ref

https://kubernetes.io/docs/tasks/administer-cluster/memory-manager/
https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
https://kubernetes.io/blog/2018/07/24/feature-highlight-cpu-manager/
https://builders.intel.com/docs/networkbuilders/cpu-pin-and-isolation-in-kubernetes-app-note.pdf

分享

Mark Zhu
作者
Mark Zhu
An old developer