linux cpu绑定到网卡,将网卡中断轮训绑定到多个cpu核心上

现象是新交付的机器网络中断只在cpu单个核心上,导致单核跑满,其它核心空闲,造成了资源浪费,性能上不去

83a819996bd4b606580807be5c4c8272.png

绑定方法如下(假设网卡是eth0):sh  set_irq_affinity -x local eth0IFACE CORE MASK -> FILE

=======================

eth0 0 1 -> /proc/irq/110/smp_affinity

eth0 0 1 -> /sys/class/net/eth0/queues/tx-0/xps_cpus

eth0 2 4 -> /proc/irq/111/smp_affinity

eth0 2 4 -> /sys/class/net/eth0/queues/tx-1/xps_cpus

eth0 4 10 -> /proc/irq/112/smp_affinity

eth0 4 10 -> /sys/class/net/eth0/queues/tx-2/xps_cpus

eth0 6 40 -> /proc/irq/113/smp_affinity

eth0 6 40 -> /sys/class/net/eth0/queues/tx-3/xps_cpus

eth0 8 100 -> /proc/irq/114/smp_affinity

eth0 8 100 -> /sys/class/net/eth0/queues/tx-4/xps_cpus

eth0 10 400 -> /proc/irq/115/smp_affinity

eth0 10 400 -> /sys/class/net/eth0/queues/tx-5/xps_cpus

eth0 12 1000 -> /proc/irq/116/smp_affinity

eth0 12 1000 -> /sys/class/net/eth0/queues/tx-6/xps_cpus

eth0 14 4000 -> /proc/irq/117/smp_affinity

eth0 14 4000 -> /sys/class/net/eth0/queues/tx-7/xps_cpus

eth0 16 10000 -> /proc/irq/118/smp_affinity

eth0 16 10000 -> /sys/class/net/eth0/queues/tx-8/xps_cpus

eth0 18 40000 -> /proc/irq/119/smp_affinity

eth0 18 40000 -> /sys/class/net/eth0/queues/tx-9/xps_cpus

eth0 20 100000 -> /proc/irq/120/smp_affinity

eth0 20 100000 -> /sys/class/net/eth0/queues/tx-10/xps_cpus

eth0 22 400000 -> /proc/irq/121/smp_affinity

eth0 22 400000 -> /sys/class/net/eth0/queues/tx-11/xps_cpus

eth0 0 1 -> /proc/irq/122/smp_affinity

eth0 0 1 -> /sys/class/net/eth0/queues/tx-0/xps_cpus

eth0 2 4 -> /proc/irq/123/smp_affinity

eth0 2 4 -> /sys/class/net/eth0/queues/tx-1/xps_cpus

eth0 4 10 -> /proc/irq/124/smp_affinity

eth0 4 10 -> /sys/class/net/eth0/queues/tx-2/xps_cpus

eth0 6 40 -> /proc/irq/125/smp_affinity

eth0 6 40 -> /sys/class/net/eth0/queues/tx-3/xps_cpus

eth0 8 100 -> /proc/irq/126/smp_affinity

eth0 8 100 -> /sys/class/net/eth0/queues/tx-4/xps_cpus

eth0 10 400 -> /proc/irq/127/smp_affinity

eth0 10 400 -> /sys/class/net/eth0/queues/tx-5/xps_cpus

eth0 12 1000 -> /proc/irq/128/smp_affinity

eth0 12 1000 -> /sys/class/net/eth0/queues/tx-6/xps_cpus

eth0 14 4000 -> /proc/irq/129/smp_affinity

eth0 14 4000 -> /sys/class/net/eth0/queues/tx-7/xps_cpus

eth0 16 10000 -> /proc/irq/130/smp_affinity

eth0 16 10000 -> /sys/class/net/eth0/queues/tx-8/xps_cpus

eth0 18 40000 -> /proc/irq/131/smp_affinity

eth0 18 40000 -> /sys/class/net/eth0/queues/tx-9/xps_cpus

eth0 20 100000 -> /proc/irq/132/smp_affinity

eth0 20 100000 -> /sys/class/net/eth0/queues/tx-10/xps_cpus

eth0 22 400000 -> /proc/irq/133/smp_affinity

eth0 22 400000 -> /sys/class/net/eth0/queues/tx-11/xps_cpus

将脚本加到开机自启动里就可以自动执行了,shell脚本下载见附件。

上传的附件:

set_irq_affinity

(大小:6.75K,下载次数:2)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值