Irqbalance
The purpose of irqbalance is distribute hardware interrupts across processors on a multiprocessor system in order to increase performance.
- # service irqbalance status
irqbalance (pid PID) is running… - # service irqbalance stop
Stopping irqbalance: [ OK ] - # chkconfig irqbalance off (# chkconfig –list [name])
RPS
Receive Packet Steering (RPS) creates a hash from the IP addresses and port
numbers, which it then uses to determine to which CPU to enqueue the packet.
The use of the hash ensures that packets for the same stream of data are sent
to the same CPU, which helps to increase performance.
--rps 是针对packet来分发给多cpu处理。是软中断。
RFS
RPS只是单纯把数据包均衡到不同的cpu,这个时候如果应用程序所在的cpu和软中断处理的cpu不是同一个,此时对于cpu cache的影响会很大,那么RFS(Receive flow steering)确保应用程序处理的cpu跟软中断处理的cpu是同一个,这样就充分利用cpu的cache
SMP affinity
/proc/irq/IRQ#/smp_affinity_list 设置该文件取得的效果与/proc/irq/IRQ#/smp_affinity是一致的,它们两者是联动关系(既设置其中之一,另一个文件也随着改变), 有些系统可能没有该文件.
对单队列网卡而言,smp_affinity和smp_affinity_list配置多CPU是没有效果的。
[比如affinity对信号3 配置cpu 0-3, 单只有一个queue,但是一个queue只能被一个cpu处理]
smp_affinity 设置会被 irqbalance 覆盖
Question:
1. 同时设置 irqbalance 和 rps/rfs 会发生什么?
2.
命令备注
- 查看当前系统中断分配 cat /proc/interrupts
- 查看某个中断对应的smp affinity value cat /proc/irq/67/smp_affinity