当前位置:网站首页>[tke] enable CPU static management strategy
[tke] enable CPU static management strategy
2022-06-24 16:38:00 【jokey】
background
By default , nodes Pod Default shared node CPU All in the pool CPU Check the number , When a lot of nodes are running CPU Dense Pod when , Workloads may switch schedules to different CPU nucleus , As a result, the performance of some workloads is significantly affected CPU The impact of cache affinity and scheduling latency . Regarding this ,kubelet Optional CPU Management strategy , Some key Pod Static binding of , avoid CPU The performance loss caused by preemption and switching to the business . Details refer to : On the control node CPU Management strategy .
TKE How to enable configuration
The following is about TKE In the open CPU There are two ways to statically manage policies .
One 、 The stock node is enabled
1. static state CPU Policy configuration
stay K8S 1.17 Before the release , Available Pod Monopoly CPU The number of resources is equal to the number of nodes CPU Total minus passing --kube-reserved or --system-reserved Parameter reserved CPU, from 1.17 Version start ,CPU The reservation list can be accessed through kublet Of '--reserved-cpus' Parameters are set explicitly . because TKE Of GA edition Usually even numbers , therefore :
- When TKE The cluster version is less than 1.18 when :
At the node /etc/kubernetes/kubelet Add the following configuration to the file :
... CPU_MANAGER_POLICY="--cpu-manager-policy=static" KUBE_RESERVED="--kube-reserved=cpu=xxx,memory=xxx" SYSTEM_RESERVED="--system-reserved=cpu=xxx,memory=xxx" ...
among , to Pods Monopoly CPU The number of resources available is equal to the number of nodes CPU Total minus passing --kube-reserved or --system-reserved Parameter reserved CPU, If you keep CPU If the quantity setting is not an integer, it will be rounded up , such as 250m, Rounding up is to keep 1 nucleus .
because TKE Of systemd Startup parameter environment variables are hard coded , So here we need to add kubelet Start parameter environment variable of CPU_MANAGER_POLICY and SYSTEM_RESERVED(KUBE_RESERVED The variable already exists by default ):
modify kubelet Of systemd Startup file /usr/lib/systemd/system/kubelet.service, Add the following environment variables to the startup parameters :
...
ExecStart=/usr/bin/kubelet ... ${CPU_MANAGER_POLICY} ${KUBE_RESERVED} ${SYSTEM_RESERVED} ...
...- When TKE The cluster version is greater than or equal to 1.18 :
At the node /etc/kubernetes/kubelet Add the following configuration to the file :
... CPU_MANAGER_POLICY="--cpu-manager-policy=static" RESERVED_CPUS="--reserved-cpus=xxx" ...
--reserved-cpus The parameter is explicitly specified as Pod Exclusive group CPU pool , Such as "--reserved-cpus=0,1,2,3", or CPU List of ranges "--reserved-cpus=0-3" It's all right .
Also modify kubelet Of systemd Startup file /usr/lib/systemd/system/kubelet.service, Add the following environment variables to the startup parameters :
...
ExecStart=/usr/bin/kubelet ... ${CPU_MANAGER_POLICY} ${RESERVED_CPUS} ...
...2. The policy configuration takes effect
Next, evict the nodes Pods, And delete kubelet Status files in the root directory cpu_manager_state To manually reset CPU Manager :
- stay TKE Console 【 The node list 】-> 【 more 】 spot 【 deportation 】 Option or execute the eviction command manually .
- stay TKE Node
cpu_manager_stateFile and restart kubelet service :
rm /var/lib/kubelet/cpu_manager_state systemctl daemon-reload systemctl restart kubelet
Two 、 The newly added node is enabled ( recommend )
Directly through customization kubelet Parameter to complete the above parameter addition , The policy configuration logic and the above inventory nodes ( First step ) The description is consistent , But at present, the user-defined parameters need to be supported , You can contact after-sales students to help open it .
summary
The above content only describes how to TKE Open static... In CPU Management strategy , About workload CPU How to configure the static binding core and precautions , see also static Strategy .
边栏推荐
- Script design for automatic login and command return
- [security] graphical CSRF injection of Web Security (II)
- Applet wxss
- Percona Toolkit series - Pt deadlock logger
- Kubernetes popular series: getting started with container Foundation
- Principle analysis of robot hardware in the loop system
- Private domain defense in the cotton Era
- Global and Chinese markets of Leyte coin exchange 2022-2028: Research Report on technology, participants, trends, market size and share
- Comparison of jmeter/k6/locust pressure measuring tools (not completed yet)
- Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk
猜你喜欢

There are potential safety hazards Land Rover recalls some hybrid vehicles

A survey of training on graphs: taxonomy, methods, and Applications

Problems encountered in the work of product manager

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)

A survey on model compression for natural language processing (NLP model compression overview)
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization

C. K-th Not Divisible by n(数学+思维) Codeforces Round #640 (Div. 4)

ZOJ - 4104 sequence in the pocket

A survey on dynamic neural networks for natural language processing, University of California
随机推荐
What is cloud development? Why cloud development? Talk about our story
Transpose convolution learning notes
Is Shanjin futures safe? What are the procedures for opening futures accounts? How to reduce the futures commission?
Finite element simulation in design
转置卷积学习笔记
Problems encountered in the work of product manager
If only 2 people are recruited, can the enterprise do a good job in content risk control?
Global and Chinese markets of stainless steel barbecue ovens 2022-2028: Research Report on technology, participants, trends, market size and share
Private domain defense in the cotton Era
How to pop up an alarm through the national standard gb28181 protocol video platform easygbs for mobile detection / perimeter intrusion detection video recording
Modern finite element analysis can easily achieve accurate results
Istio FAQ: virtualservice route matching sequence
对深度可分离卷积、分组卷积、扩张卷积、转置卷积(反卷积)的理解
Ps\ai and other design software pondering notes
Load MySQL table data consumption quick installation configuration through kafka/flink
Cause analysis of the failure of web page live broadcast on demand RTMP streaming platform easydss streaming live broadcast
Handling of communication failure between kuberbetes pod
[tke] modify the cluster corendns service address
6 things all engineers should know before FEA
C. Three displays codeforces round 485 (Div. 2)