LinuxCommandLibrary

irqbalance

Distribute hardware interrupts across CPUs

SYNOPSIS

irqbalance [options]

PARAMETERS

-f, --foreground
    Run in foreground; do not daemonize

-o, --oneshot
    Run once, then exit (useful for testing)

-v, --verbose
    Enable verbose logging

-p PIDFILE, --pidfile=PIDFILE
    Write daemon PID to specified file

--interval=N
    Set balancing interval to N seconds (default: 10)

--banirq=NUM
    Ban IRQ NUM from balancing (can repeat)

-h, --help
    Display help and exit

-V, --version
    Output version information

--powerthresh=P
    Set power saving threshold (advanced)

--debug=level
    Enable debug output at specified level

DESCRIPTION

irqbalance is a Linux daemon that optimizes system performance on multi-processor SMP systems by dynamically distributing hardware interrupts (IRQs) across available CPUs. Without balancing, interrupts from high-volume devices like network cards or storage controllers can overload a single CPU core, causing bottlenecks, increased latency, and suboptimal throughput.

The daemon periodically (default every 10 seconds) monitors CPU load, interrupt counts, and system topology (including NUMA and cache hierarchies). It uses heuristics to compute an optimal distribution, then sets IRQ affinity via /proc/irq/*/smp_affinity to spread interrupts evenly. This reduces per-CPU interrupt handling overhead and improves scalability on multi-core systems.

Key benefits include better responsiveness for interrupt-heavy workloads, such as servers handling high I/O or networking traffic. It respects CPU hotplug events and can be tuned for power savings on laptops. irqbalance is lightweight, typically consuming minimal CPU. It's enabled by default on many distributions (e.g., RHEL, Fedora) as a systemd service, but can run manually. For specialized setups, options allow banning specific IRQs or adjusting intervals. Note that kernel smp_affinity support is required (standard since kernel 2.6).

CAVEATS

Requires root privileges; may conflict with tuned profiles or manual IRQ affinity settings. Not ideal for real-time systems. On single-core systems, it exits harmlessly. Configured IRQs (e.g., via device drivers) override balancing.

CONFIGURATION FILE

Settings in /etc/default/irqbalance or /etc/sysconfig/irqbalance (distro-specific), e.g., BALANCEDIR= for custom affinity masks.

SERVICE MANAGEMENT

Managed via systemd: systemctl enable --now irqbalance. Logs in journalctl.

HISTORY

Originally developed by Neil Horman at Red Hat around 2005 for kernel 2.6 SMP systems. Maintained upstream on GitHub; integrated into major distros like Fedora/RHEL since 2006. Recent versions (1.9+) add NUMA awareness and power-saving heuristics.

SEE ALSO

taskset(1), chrt(1), numactl(8), systemd(1)

Copied to clipboard