当前位置:网站首页>[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 .
边栏推荐
- TRTC web end imitation Tencent conference microphone mute detection
- Principle analysis of robot hardware in the loop system
- 2021 devopsdays Tokyo Station ends perfectly | coding experts are invited to share the latest technical information
- Yuanqi forest started from 0 sugar and fell at 0 sugar
- Introduction of thread pool and sharing of practice cases
- Enterprise security attack surface analysis tool
- API documents are simple and beautiful. It only needs three steps to open
- C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)
- C. Three displays codeforces round 485 (Div. 2)
- Clickhouse high performance column storage core principle
猜你喜欢

B. Ternary Sequence(思维+贪心)Codeforces Round #665 (Div. 2)

A survey on dynamic neural networks for natural language processing, University of California

Ui- first lesson

Ps\ai and other design software pondering notes

C. Three displays codeforces round 485 (Div. 2)

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

ZOJ - 4104 sequence in the pocket

Problems encountered in the work of product manager

Cognition and difference of service number, subscription number, applet and enterprise number (enterprise wechat)

C. K-th Not Divisible by n(数学+思维) Codeforces Round #640 (Div. 4)
随机推荐
Interpretation of swin transformer source code
[golang] Introduction to golang (I) establishment of running environment
The RTSP video structured intelligent analysis platform easynvr stops calling the PTZ interface through the onvif protocol to troubleshoot the pending status
[tke] modify the cluster corendns service address
What is browser fingerprint recognition?
Find out the invisible assets -- use hosts collision to break through the boundary
2021 devopsdays Tokyo Station ends perfectly | coding experts are invited to share the latest technical information
Development trend of CAE simulation analysis software
What is zero trust? Three classes will show you how to understand him!
Data acquisition and transmission instrument reservoir dam safety monitoring
Factory mode
Applet - use of template
Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk
Comparison of jmeter/k6/locust pressure measuring tools (not completed yet)
mysql时间戳格式转换日期格式字符串
ThinkPHP vulnerability exploitation tool
找出隐形资产--利用Hosts碰撞突破边界
Principle analysis of robot hardware in the loop system
[play with Tencent cloud] my operation strategy from domain name application to website filing in Tencent cloud
Is Guotai Junan Futures safe? How to open a futures account? How to reduce the futures commission?