为什么要绑核
绑核是为了提高CPU的性能,减少上下文切换的性能损失。
精准的绑核,可以不浪费CPU的资源。
不同版本的绑核
7.3+版本
在官方7.3版本中放出,如果是7.3+的版本,直接在web上就可以绑定核心。
不同的翻译版本,可能不一样,可以在英文界面affinity对应。
7.3之前版本
这种方式需要使用taskset命令手动绑核。
比如 taskset -c 1-3 qm start 101
如果虚拟机已经在运行,可以找出pid,继续使用taskset -cp 1-3 [pid]进行绑定
绑核规则
同一个超线程组建议在一起。同一个socket下的cpu建议在一起。amd建议一个ccd的在一起。
绑核语法
语法就是根据taskset来的。
如果是要绑定cpu1到cpu10,就是1-10,如果要加上cpu19,就是1-10,19。中间用逗号隔开。
The third CPU resource limiting setting, affinity, controls what host cores the virtual machine will be permitted to execute on. E.g., if an affinity value of 0-3,8-11 is provided, the virtual machine will be restricted to using the host cores 0,1,2,3,8,9,10, and 11. Valid affinity values are written in cpuset List Format. List Format is a comma-separated list of CPU numbers and ranges of numbers, in ASCII decimal.
官方文档原话,7.3+的,CPU核心是从0开始算的
笔误? “如果是要绑定cpu1到cpu10,就是1-10,如果要加上cpu19,就是1-10,9。中间用逗号隔开。” 应该是 1-10,19吧
嗯,是19,改了。谢谢
64 x Intel(R) Xeon(R) CPU E5-2698 v3 @ 2.30GHz (2 插槽) 我试了一下 只开numa cpuz跑分单核360 多核8770 绑核不开numa 360/5600 这是啥原因啊 我确定绑核没问题 但并没有性能提升
不知道你怎么操作的