Ring Buffer Sizing, Drop Counters, and Softirq CPU Affinity
Many system administrators instinctively increase network card ring buffers to maximum capacity (e.g. 4096 descriptors via ethtool -G) as soon as drops appear in rx_discards_phy. On high-speed servers, oversized ring buffers create cache misses because the working set of descriptors exceeds the CPU L2/L3 cache capacity.
Through systematic stress testing under varying packet size distributions, we found that a descriptor ring size of 1024 or 2048 paired with strict IRQ core pinning (isolating softirqs from user worker threads) delivered the optimal balance: zero packet loss during 10-second traffic spikes and a 22% improvement in L3 cache hit rates.
# Query current vs maximum descriptor settings
ethtool -g eth0
# Pin RX queues to dedicated cores
set_irq_affinity 2-4 eth0