1.后台top查看:
2.查看irqbalance状态:
3.关闭irqbalance:
systemctl status irqbalance
4.查看网卡中断号:cat /proc/interrupts |grep s1p1
得到中断号
本来grep s1p6,但是中断这里名字还是eth7
查看cpu内函数:lscpu
手动绑定中断号:
单个绑定:
批量绑定:
[root@localhost ~]# cat setaff.sh #!/bin/bash for((i=0,j=291;i<32;i++,j++)) do echo $i > /proc/irq/$j/smp_affinity_list done
top再次查看,负载均衡了
注:改下eth_set_irq.php里的网卡名称识别前缀也可以
总结:
#!/bin/bash # 获取软中断进程号:cat /proc/interrupts |grep s1p2 for((i=0,j=151;i<40;i++,j++)) do # 手动绑定网卡 echo $i > /proc/irq/$j/smp_affinity_list done
原文:https://www.cnblogs.com/gufengchen/p/14204788.html