Interrupt coalescing (also called interrupt moderation) is a technique used by NICs and storage adapters to reduce the number of CPU interrupts by grouping multiple I/O events together before notifying the processor.
π Core Idea
Instead of generating an interrupt for every packet or I/O completion, the device waits for:
-
A time threshold (e.g., 50 Β΅s), or
-
A packet count threshold (e.g., 32 packets)
β¦and then raises one interrupt for many events.
βοΈ How It Optimizes I/O Processing
1. Reduces Interrupt Rate
Without coalescing:
With coalescing:
π Fewer interrupts = less CPU overhead
2. Improves CPU Efficiency
-
Each interrupt involves:
-
Context switch
-
Cache disruption
-
Coalescing batches work β CPU processes multiple packets per interrupt
π Result:
-
Better cache utilization
-
Higher throughput per CPU core
3. Enables Batch Processing
-
OS/network stack processes packets in groups instead of one-by-one
-
Works well with:
-
Large receive offload (LRO)
-
TCP segmentation offload (TSO)
π Effect:
-
Increased packets-per-second (PPS) handling capability
4. Reduces Hypervisor Overhead
In virtualized environments (e.g., IBM PowerVM):
-
Fewer interrupts crossing:
-
Device β Hypervisor β VM
π Especially beneficial when using:
-
Virtual I/O Server (VIOS)
-
Shared I/O adapters
5. Prevents Interrupt Storms
-
High-speed NICs (25/100 GbE) can overwhelm CPUs with interrupts
-
Coalescing throttles interrupt frequency
π Ensures system stability under heavy load
π Trade-off: Latency vs Throughput
| Setting | Effect |
|---|
| Aggressive coalescing | β
High throughput, β Higher latency |
| Low/no coalescing | β
Low latency, β Higher CPU usage |
π Example:
-
50 Β΅s delay adds slight latency
-
But dramatically improves throughput and CPU efficiency
β‘ Real-World Impact
Without Coalescing
-
High CPU usage
-
Lower throughput under load
-
Interrupt bottlenecks
With Coalescing
-
20β50% lower CPU usage (typical)
-
Higher network/storage throughput
-
Better scalability for multi-core systems
π― When to Tune It
Use higher coalescing for:
-
Bulk data transfer
-
Backup/restore
-
Data lakes / analytics
-
High-throughput networking
Use lower coalescing for:
-
Low-latency trading systems
-
Real-time apps
-
Small, latency-sensitive I/O
π§ Key Insight
Interrupt coalescing improves performance by trading a tiny amount of latency for a large gain in CPU efficiency and throughput, which is critical in modern high-speed I/O systems.