NIC, Switch Buffer and IRQ Tuning for Game Servers

Packet loss on a game server is rarely caused by “not enough bandwidth.” In most incidents we have traced, the uplink has 60-80% headroom while players still see 20-60 ms of jitter spikes every evening. The culprit is usually three settings: undersized NIC receive buffers, offload features that batch interrupts instead of delivering them, and switch ports that drop bursts during micro-congestion. This article covers the corrections, the counters to read before and after, and values that work on 1G and 10G game nodes.

Treat these settings as a sequence, not a menu. Buffer sizing only helps if interrupts are also mapped correctly, and IRQ pinning only helps if the CPU is not busy-stealing the core you pinned to. Change one layer per test window so you can attribute the delta.

Read the Drop Counters Before Touching Anything

On Linux, ethtool -S eth0 and /proc/net/softnet_stat tell most of the story. A rising rx_missed_errors, rx_no_buffer_count, or rx_fifo_errors means the ring buffer filled faster than the kernel drained it. In softnet_stat, column 2 (the second field after the hex address) counts packets dropped because the per-CPU backlog exceeded netdev_max_backlog; any non-zero increment during a player load test is a real defect, not noise.

A single 128-slot RX ring on a 1G NIC is about 190 KB of buffer at 1500-byte packets, roughly 1.5 ms of traffic at line rate. A map-change snapshot can blow through that in one packet train, which is why drops cluster around loading screens rather than during steady play.

Size Ring Buffers to the Burst, Not the Average

Set RX and TX rings to the maximum the driver allows with ethtool -G eth0 rx 4096 tx 4096, then verify with ethtool -g eth0 that the change was accepted and not silently clamped. On Intel i40e and ixgbe parts, 4096 is the practical ceiling; on some virtio NICs the cap is 1024, and on those you must compensate with CPU budget rather than buffer depth.

Larger rings raise worst-case latency slightly because packets sit longer in the queue, but at 4096 slots on 10G the added latency is under 0.35 ms, which is invisible against a 30 ms tick window. Do not raise rings on a host that is CPU-saturated: a deep queue draining into an overloaded core converts a clean drop into a 100 ms stall.

NIC class Default RX ring Target RX ring Observed drop reduction (load test)
1G Intel igb (entry node) 256 2048 ~18x fewer rx_missed_errors
10G Intel ixgbe 512 4096 ~12x fewer rx_no_buffer_count
10G Mellanox mlx5 1024 4096 ~4x fewer out-of-buffer drops
Virtio (VM node) 256 1024 (cap) ~2x, needs CPU headroom

Turn Off Interrupt Coalescing for Tick-Critical Ports

Interrupt coalescing groups packets into batches to save CPU. On a game node it adds 20-100 microseconds of wake-up delay per packet train, and under a burst it can hold hundreds of small packets behind the coalesce timer. Run ethtool -c eth0 and, for dedicated game ports, set adaptive RX off with ethtool -C eth0 adaptive-rx off rx-usecs 0.

The trade-off is CPU: on a 10G port at 6 Gbit/s of small packets, one core can go from 25% to 70% utilisation. Measure with mpstat -P ALL 1 during a load test. If the interrupt core exceeds 60%, keep rx-usecs at 4-8 rather than 0.

Pin IRQs to Cores Away From the Game Process

On multi-queue NICs each RX queue raises its own interrupt. Read the affinity map with /proc/interrupts, then for a node running a single game instance on cores 2-11, pin the NIC interrupts to cores 0-1. Use grep eth0 /proc/interrupts to find the queue lines and write the CPU mask into /proc/irq/<n>/smp_affinity_list, or use irqbalance --banirq to exclude the game NIC.

A common failure is pinning every queue to core 0. That collapses 8 hardware queues onto one core, which then processes interrupts, softirq, and the game’s network reads in the same timeslice. Spreading queues across two dedicated cores while banning them from game cores typically cuts p99 tick jitter by 30-50% on a loaded node.

Match Switch Port Configuration to the Burst Profile

Many dedicated providers hand off a 1G port on a switch shared with dozens of other customers. If the port is configured with a small egress queue, or with flow control disabled on one side only, your burst can be dropped by the switch before your NIC ever sees it. Ask your provider whether the access port has PFC or at minimum 802.3x flow control consistent on both ends.

A signature of switch-side drops is a clean local NIC report (no rx errors) while players report spikes. Confirm by watching tc -s qdisc show dev eth0 for drops on the local side; if those stay at zero during a spike, the loss is upstream. Our dedicated servers expose port counters on request so this can be checked from both ends in the same minute.

Verify With a Repeatable Test, Then Freeze the Config

Build a baseline with 90% of target players for 15 minutes, log ethtool -S, softnet_stat, and a per-tick loop latency histogram, then rerun after each change. A useful acceptance gate is: zero packet drops on the NIC, softnet backlog drops at zero, and p99 tick latency under 3x the median. Anything beyond that is still a defect.

Write the final ring size, coalesce values, and IRQ affinity into a boot-time unit so a kernel or driver update cannot silently reset them. Persist the ethtool calls in a systemd service that runs after networking, and log the applied values to the journal so the next change window starts from a known state.

When Buffering Stops Helping

If you have maxed rings, disabled coalescing, and pinned IRQs, and still see drops, the node is CPU-bound on network processing rather than buffer-bound. That is the signal to move up a class: fewer, faster cores for interrupts, or a NIC with more queues such as 4x10G or 2x25G bonded. Review the recommended port and core pairing on our gaming server plans before buying bandwidth you will never use.

The practical summary: size buffers for the burst, remove interrupt batching, separate network cores from game cores, and confirm switch-side policy. Those four steps resolve most tick-jitter complaints that get misdiagnosed as “provider packet loss.”

Leave a Reply