Skip to content

irqbalance - Interrupt Distribution Tuning Cheatsheet

irqbalance - Interrupt Distribution Tuning Cheatsheet

irqbalance is a daemon that distributes hardware interrupts (IRQs) across CPU cores. By default Linux may route most interrupts from a busy NIC or storage controller to CPU 0, making that core a bottleneck while others idle. irqbalance monitors interrupt load and rebalances IRQ affinity to spread the work. Conversely, for latency-critical workloads with hand-pinned CPUs, it is often deliberately disabled so it cannot move interrupts onto isolated cores.

Installation

PlatformCommand
Debian/Ubuntusudo apt install irqbalance
Fedora/RHELsudo dnf install irqbalance
Arch Linuxsudo pacman -S irqbalance
Servicesudo systemctl enable --now irqbalance
Verifyirqbalance --version

Inspecting Interrupts First

CommandShows
cat /proc/interruptsPer-CPU interrupt counts by device
watch -n1 'cat /proc/interrupts'Live growth (spot the hot core)
mpstat -I SUM -P ALL 1Interrupts per CPU per second
cat /proc/irq/<N>/smp_affinityAffinity mask for one IRQ
cat /proc/irq/<N>/smp_affinity_listSame, as a CPU list
# Is one CPU absorbing all NIC interrupts?
watch -n1 "grep -E 'eth0|mlx|ens' /proc/interrupts"

Running the Daemon

CommandDescription
sudo systemctl status irqbalanceCheck it is running
sudo irqbalance --foregroundRun in foreground (debugging)
sudo irqbalance --oneshotBalance once, then exit
sudo irqbalance --debugVerbose decisions

Key Options / Environment

SettingEffect
IRQBALANCE_BANNED_CPUS=<mask>Never assign IRQs to these CPUs
--banirq=NExclude a specific IRQ from balancing
--policyscript=PATHScript that decides per-IRQ policy
--interval=SECONDSRebalance interval
`—hintpolicy=exactsubset
--powerthresh=NPower-save consolidation threshold

Configuration usually lives in /etc/default/irqbalance or /etc/sysconfig/irqbalance.

# Keep IRQs off isolated cores 8-15 (mask for CPUs 8..15)
echo 'IRQBALANCE_BANNED_CPUS=0000ff00' | sudo tee -a /etc/default/irqbalance
sudo systemctl restart irqbalance

Manual IRQ Affinity (when you disable the daemon)

# Pin IRQ 42 to CPU 2 (bitmask 0x4)
echo 4 | sudo tee /proc/irq/42/smp_affinity

# Or by CPU list
echo 2 | sudo tee /proc/irq/42/smp_affinity_list
ApproachUse
irqbalance runningGeneral servers, variable load
irqbalance disabled + manual pinningLow-latency, NUMA-pinned, RT workloads
Banned CPUsHybrid: balance, but protect isolated cores

Latency-Critical Pattern

# Typical low-latency setup: stop the balancer, pin NIC IRQs near the app's NUMA node
sudo systemctl stop irqbalance
sudo systemctl disable irqbalance
# then set smp_affinity for the NIC's IRQs to cores on the same NUMA node

Pair with numactl so the application’s memory and the interrupt handling live on the same NUMA node — cross-node interrupt handling is a classic hidden latency source.

Verifying the Change

CheckCommand
Interrupt spreadmpstat -I SUM -P ALL 1
Softirq loadtop%si per CPU
Network throughputsar -n DEV 1
Per-IRQ countswatch 'cat /proc/interrupts'

Success looks like interrupt counts growing evenly across intended cores (or concentrated on exactly the cores you chose).

ToolRole
irqbalanceDistribute IRQs across CPUs
numactlBind process CPU/memory to NUMA nodes
cpupowerFrequency/idle-state control
tunedWhole-system profiles (may manage irqbalance)
RPS/RFSSoftware-side packet steering

Resources