同一台主机,同样的workload,kubelet 中配置CPU绑定后的性能变化:
绑核的配置放在 /etc/kubernetes/kubelet 中的这两行:
```
FEATURE_GATES="--feature-gates=CPUManager=true"
CPU_MANAGER_POLICY="--cpu-manager-policy=static"
```
绑核前:
```
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
4 0 0 6159128 1802352 13682656 0 0 0 1224 86138 124250 16 6 77 0 0
6 0 0 6145752 1802352 13696656 0 0 0 1560 88535 128873 15 6 79 0 0
1 0 0 6125308 1802352 13711204 0 0 0 586 88054 126991 15 6 78 0 0
5 0 0 6110088 1802352 13726124 0 0 0 700 88863 128641 15 6 78 0 0
0 0 0 6096360 1802352 13741036 0 0 0 1560 87733 127629 14 6 79 1 0
1 0 0 6082832 1802352 13755752 0 0 0 33602 89644 129308 17 7 76 1 0
0 1 0 6071792 1802352 13770408 0 0 0 1640 87041 125529 15 6 79 0 0
3 0 0 6059344 1802352 13785396 0 0 0 1240 88503 127942 17 6 76 0 0
2 0 0 6028172 1802352 13800168 0 0 0 45362 90060 131117 13 7 79 1 0
2 0 0 6027448 1802352 13815088 0 0 0 1052 87804 127524 16 7 77 0 0
1 0 0 6015260 1802352 13829772 0 0 0 1088 87335 126040 18 7 75 0 0
2 0 0 6002788 1802352 13844216 0 0 0 1680 90058 131049 13 6 81 0 0
2 0 0 5990180 1802352 13858160 0 0 0 1210 85920 124370 14 6 80 0 0
4 0 0 5975628 1802352 13873584 0 0 0 1138 86549 125064 18 6 75 1 0
6 0 0 5930484 1802352 13886808 0 0 0 1032 86490 125179 13 6 80 0 0
2 0 0 5944408 1802352 13900304 0 0 0 33056 90993 131884 17 7 75 1 0
2 0 0 5932832 1802356 13913912 0 0 0 1008 86452 125517 16 6 78 0 0
1 0 0 5915472 1802356 13928420 0 0 0 650 86732 124668 14 6 79 0 0
3 1 0 6105740 1802356 13736692 0 0 0 44264 88458 128425 12 6 82 1 0
4 0 0 6082452 1802360 13751416 0 0 0 2070 87688 126043 17 6 77 1 0
20 0 0 6077500 1802360 13764656 0 0 0 976 89384 129504 17 6 77 0 0
1 0 0 6063304 1802360 13779528 0 0 0 824 92429 134769 15 7 78 0 0
4 0 0 6089368 1802360 13753572 0 0 0 1286 86069 124188 16 6 78 1 0
7 0 0 6073512 1802360 13768636 0 0 0 878 86214 124614 14 6 79 0 0
4 0 0 6060264 1802360 13783224 0 0 0 1128 89458 129962 16 6 78 0 0
2 0 0 6048572 1802360 13795916 0 0 0 910 87582 127348 14 6 80 0 0
2 0 0 6035236 1802360 13811208 0 0 0 1206 87067 126021 14 6 79 0 0
2 0 0 6020364 1802360 13824332 0 0 0 1332 85369 122795 16 6 77 1 0
4 1 0 6005336 1802360 13840492 0 0 0 40098 89581 130677 13 6 80 1 0
1 0 0 5989392 1802360 13853996 0 0 0 43548 88476 128296 14 7 78 1 0
0 1 0 5975844 1802360 13868992 0 0 0 1742 88002 127064 17 7 75 1 0
19 0 0 5959928 1802360 13883400 0 0 0 2778 85611 123932 14 6 80 0 0
0 0 0 5944276 1802360 13897744 0 0 0 1056 91356 134075 15 7 78 0 0
7 0 0 5934184 1802360 13912112 0 0 0 1030 90760 131217 18 6 75 0 0
2 0 0 5916740 1802360 13926860 0 0 0 1430 87548 126016 21 7 72 1 0
4 0 0 5900764 1802360 13941700 0 0 0 1142 92745 134964 19 8 73 0 0
12 0 0 5889376 1802360 13955900 0 0 0 1210 90261 130363 16 6 77 0 0
1 0 0 5875396 1802360 13969580 0 0 0 818 83964 120959 14 6 80 0 0
0 0 0 5863000 1802360 13984060 0 0 0 888 88928 129248 13 6 81 0 0
3 0 0 5849992 1802360 13997076 0 0 0 1518 84515 121722 15 6 78 1 0
3 0 0 5830520 1802360 14011568 0 0 0 830 90261 130549 16 7 77 0 0
6 0 0 5819300 1802360 14025252 0 0 0 40448 89598 129688 16 7 77 1 0
4 0 0 5807020 1802360 14039192 0 0 0 53194 85185 122680 14 6 80 1 0
```
绑核后:
```
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
4 0 0 15591124 1802844 8789620 0 0 0 1168 70281 102084 13 5 82 1 0
1 0 0 15585856 1802844 8795204 0 0 0 256 63285 90959 8 4 88 0 0
1 0 0 15582688 1802844 8800956 0 0 0 69512 68612 99120 12 6 81 1 0
2 0 0 15573724 1802844 8807608 0 0 0 888 70456 102849 11 5 85 0 0
1 0 0 15549516 1802844 8815268 0 0 0 972 67492 96287 12 5 83 0 0
0 1 0 15543172 1802844 8821240 0 0 0 1648 66204 95521 9 5 86 0 0
6 0 0 15543404 1802844 8826960 0 0 0 576 71953 105177 11 4 85 0 0
5 0 0 15537660 1802844 8833188 0 0 0 4180 68660 99105 12 5 83 1 0
1 0 0 15534848 1802844 8839592 0 0 0 1056 67483 97607 9 5 86 0 0
2 0 0 15528880 1802844 8844828 0 0 0 668 66577 95527 13 5 82 0 0
4 0 0 15527100 1802844 8851680 0 0 0 336 68113 98819 8 4 88 0 0
0 0 0 15521352 1802844 8857524 0 0 0 692 67475 97495 12 5 83 0 0
2 0 0 15518212 1802844 8862920 0 0 0 680 65806 95155 10 4 86 0 0
4 0 0 15511900 1802844 8869288 0 0 0 1516 68276 98932 13 5 82 0 0
4 0 0 15483040 1802844 8876388 0 0 0 556 67930 98994 13 4 83 0 0
3 0 0 15483940 1802844 8881304 0 0 0 1608 68221 99308 9 5 86 0 0
1 0 0 15478776 1802848 8887212 0 0 0 62768 65518 93876 12 5 82 2 0
0 0 0 15473868 1802848 8893572 0 0 0 392 66978 97747 10 4 86 0 0
4 0 0 15469008 1802848 8899528 0 0 0 1684 66687 96210 12 4 83 1 0
2 0 0 15458932 1802848 8906084 0 0 0 220 67962 98787 9 4 87 0 0
0 0 0 15456116 1802848 8911904 0 0 0 916 73493 108695 14 6 80 0 0
2 0 0 15449168 1802852 8918540 0 0 0 1640 69624 101834 8 4 88 0 0
0 0 0 15438724 1802852 8924676 0 0 0 1100 69444 100601 11 5 84 0 0
1 0 0 15437056 1802852 8929800 0 0 0 1132 63248 91326 11 4 85 0 0
1 0 0 15425460 1802852 8936896 0 0 0 600 65632 95902 11 5 84 0 0
1 0 0 15425412 1802852 8943004 0 0 0 616 70796 103407 12 5 83 0 0
3 0 0 15420492 1802852 8949048 0 0 0 1576 66840 97535 10 4 86 0 0
1 0 0 15412484 1802852 8955036 0 0 0 508 68913 99669 13 4 83 0 0
2 0 0 15404492 1802852 8961676 0 0 0 89856 71175 103442 10 5 84 1 0
1 0 0 15400724 1802852 8967892 0 0 0 784 72143 105485 14 5 81 0 0
0 0 0 15395908 1802852 8974056 0 0 0 256 69504 102125 9 4 87 0 0
5 1 0 15391588 1802852 8979656 0 0 0 1740 67029 96847 14 5 80 1 0
2 0 0 15386888 1802852 8985468 0 0 0 312 72599 106485 9 5 86 0 0
2 0 0 15385880 1802852 8992236 0 0 0 1684 68600 100277 13 5 81 1 0
3 0 0 15348016 1802852 9001048 0 0 0 600 68017 97934 11 5 84 0 0
2 0 0 15342592 1802852 9006312 0 0 0 1136 64758 93202 12 4 83 1 0
1 0 0 15333560 1802852 9013396 0 0 0 50052 73336 107734 8 5 85 1 0
2 0 0 15332308 1802852 9018840 0 0 0 952 69331 101299 13 5 82 0 0
4 0 0 15324944 1802852 9025712 0 0 0 1056 66476 95956 9 5 86 0 0
0 0 0 15319160 1802852 9031328 0 0 0 928 71603 104970 13 5 82 0 0
7 0 0 15313560 1802852 9037888 0 0 0 1132 71578 105082 9 5 86 1 0
7 0 0 15307180 1802852 9044540 0 0 0 736 68055 98517 17 5 78 0 0
3 0 0 15301144 1802852 9050184 0 0 0 1636 67757 98428 8 5 88 0 0
```
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传