High Network IOPS or Traffic
Binding NIC Interrupts to CPU Cores
- Disable irqbalance.
Before binding cores to NICs, disable irqbalance.
- Stop the irqbalance service. (The setting will be invalid after the system restarts.)
systemctl stop irqbalance.service - Disable the irqbalance service. (The setting will be permanently valid.)
systemctl disable irqbalance.service - Check the irqbalance service status.
systemctl status irqbalance.service
- Stop the irqbalance service. (The setting will be invalid after the system restarts.)
- Query the PCI device number of the NIC (for example, enp131s0).
ethtool -i enp131s0The command output is as follows:
driver:hinic version:2.3.2.1 firmware-version:2.3.2.1
- Query the NUMA node to which the PCIe NIC belongs.
lspci -vvvs <bus-info>
The command output is as follows:

- View the core range corresponding to the NUMA node. In this example, the NUMA node can be bound to CPU cores 48 to 71.
lscpu

- Bind the interrupts to 16 cores on the NUMA node. In this example, there are 16 queues for the 1822 NIC and the interrupts are bound to cores 48 to 63 on NUMA node 2.
The script content is as follows:
#!/bin/bash irq_list=(`cat /proc/interrupts | grep enp131s0 | awk -F: '{print $1}'`) cpunum=48 # Change the value to the first CPU core of the node. for irq in ${irq_list[@]} do echo $cpunum > /proc/irq/$irq/smp_affinity_list echo `cat /proc/irq/$irq/smp_affinity_list` (( cpunum+=1 )) doneEdit the script.
bash smartIrq.sh
- Check whether the CPU core binding is successful.
The script content is as follows:
#!/bin/bash # NIC name intf=$1 log=irqSet-`date "+%Y%m%d-%H%M%S"`.log # Number of available CPUs cpuNum=$(cat /proc/cpuinfo |grep processor -c) # RX and TX interrupt lists irqListRx=$(cat /proc/interrupts | grep ${intf} | awk -F':' '{print $1}') irqListTx=$(cat /proc/interrupts | grep ${intf} | awk -F':' '{print $1}') # Bind the RX interrupt requests (IRQs). for irqRX in ${irqListRx[@]} do cat /proc/irq/${irqRX}/smp_affinity_list done # Bind the TX IRQs. for irqTX in ${irqListTx[@]} do cat /proc/irq/${irqTX}/smp_affinity_list doneCheck whether the CPU core binding is successful.
sh irqCheck.sh enp131s0
The command output is as follows:

Parent topic: %IRQ