3 minute read
Static CPU manager is supported by kubelet, when a guaranteed Pod is running on a node, kubelet allocate specific cpu cores to the processes exclusively, which generally keeps the cpu utilization of the node low. This proposal provides a new mechanism to manage cpusets, which allows sharing cpu cores with other processes while binds cpuset.It also allows to revise cpuset when pod is running and relaxes restrictions of binding cpus in kubelet.
Some latency-sensitive applications have lower lantency and cpu usage when running with specific cores, which results in fewer context switches and higer cache affinity. But kubelet will always exclude assigned cores in shared cores, which may waste resources.Offline and other online pods can running on the cores actually. In our experiment, for the most part, it is barely noticeable for performance of service.
Kubelet allocate cpus for containers should meet the conditions:
requests and limits are specified for all the containers and they are equal
the container’s resource limit for the limit of CPU is an integer greater than or equal to one and equal to request request of CPU.
In Crane, only need to meet condition No.2
apiVersion: v1
kind: Pod
metadata:
annotations:
qos.gocrane.io/cpu-manager: none/exclusive/share
Provide three polices for cpuset manager:
make pod from none to share without recreating pod
make pod from exclusive to share, so offline process can use these CPUs