Measuring and Cutting Network Jitter on Game Servers (Not Average Ping)

Most hosting dashboards show average latency and call it a day. Average ping is a comfortable lie: a server that replies in 20 ms on average can still deliver 200 ms spikes every few seconds, and those spikes are what players actually feel as rubber-banding and missed shots. What matters is jitter — the variance in round-trip time — and you can measure and reduce it deliberately with the Linux networking tools already on your box.

Why Averages Hide the Problem

Latency is a position; jitter is the spread around it. Two servers can both report 30 ms average, but one holds a tight 28-33 ms band while the other swings 20-90 ms. Competitive players notice the swing, not the center. A useful summary statistic is the p95 minus median gap: if that exceeds roughly 10 ms, players will feel inconsistency regardless of how good the median looks.

Measuring Jitter With ping and Variance

You do not need a commercial APM tool to establish the baseline. Send a burst of probes and compute the spread:

  • Run ping -c 200 -i 0.05 target from a client to capture 200 samples quickly.
  • Compute mean, median, p95, and standard deviation from the RTT column.
  • Track delta jitter (the average difference between consecutive RTTs) — this catches spikes that standard deviation understates.

For a server-side view, mirror the traffic to a capture port and timestamp packets with tcpdump plus hardware timestamps. The comparison between client-side and server-side jitter tells you whether the spread is generated in the network path or inside the game process itself.

Injecting Controlled Jitter With tc netem

The Linux traffic-control subsystem, tc, includes the netem (network emulation) discipline. It lets you add delay, jitter, reordering, and loss to an interface so you can reproduce bad-player conditions on a controlled test link:

Goaltc netem command (egress on eth0)
Add 40 ms delaytc qdisc add dev eth0 root netem delay 40ms
Add delay + jittertc qdisc add dev eth0 root netem delay 40ms 10ms
Add 1% losstc qdisc add dev eth0 root netem loss 1%
Remove all emulationtc qdisc del dev eth0 root

Always pin the emulation to a test interface or a specific destination so you never degrade live players. Use it to reproduce a reported spike, confirm the game reacts as expected, and verify a fix before shipping it. Remember netem only shapes egress on the local interface; for bidirectional tests, apply it on both endpoints.

Reducing Jitter on the Server

Once you can see and inject jitter, the fixes become concrete. Common sources and remedies:

  • Bufferbloat — oversized queues deliver latency under load; cap the queue and enable CoDel or fq_codel so a handful of bulk transfers cannot build a standing buffer.
  • CPU scheduling — the game thread getting preempted by housekeeping tasks adds processing jitter; pin the game process and isolate its cores.
  • Interrupt coalescing — NICs batching interrupts for efficiency add microseconds of variance; reduce coalescing on latency-sensitive interfaces.
  • Power states — C-state wake latency shows up as jitter; disable deep C-states on game hosts.

Queue discipline tuning is well covered in our game server tuning resources, and if path-level jitter persists after your server is clean, the cause is outside your rack and requires a different peering route — see our high-traffic server solutions.

A Repeatable Jitter Checklist

  • Record p50, p95, and delta jitter per server every five minutes, not just average ping.
  • Alert on p95-median exceeding 10 ms, not on average.
  • Reproduce any reported spike with tc netem before assuming the network is at fault.
  • Apply fq_codel, core isolation, and coalescing tuning, then re-measure to confirm the change helped.

Measure variance, not averages. A server that reports an unremarkable mean latency but keeps its p95 within a few milliseconds of the median will feel better to players than one with a lower average and a wide, spiky distribution.

Bufferbloat: The Most Common Server-Side Cause

If your ping to an idle server is 25 ms but jumps to 150 ms the moment a player downloads a map or a backup runs, you have bufferbloat. The router or host absorbs bursts into an oversized queue instead of dropping them, and every packet behind the burst waits. The fix is a fair-queueing discipline with active queue management. On modern kernels, enable fair queueing with CoDel on the latency-sensitive interface so no single flow can build a standing buffer:

  • tc qdisc add dev eth0 root fq_codel — the default fair-queueing plus CoDel discipline on most Linux distributions.
  • tc qdisc add dev eth0 root cake bandwidth 900mbit — CAKE also shapes to a bandwidth ceiling, useful when the uplink is shared.
  • Verify with tc -s qdisc show dev eth0 and watch the drops/overlimits counters move under load.

Shaping slightly below your committed bandwidth (for example CAKE at 900 Mbit on a 1 Gbit link) is deliberate: it forces the queue to form on the host, where CoDel can manage it, rather than in the upstream switch where you have no control.

Interrupt Coalescing and NIC Tuning

Network cards batch packet interrupts to save CPU, delivering several packets per interrupt. That batching is efficient for throughput but adds a variable delay of up to a few hundred microseconds to each packet — enough to widen your jitter band. On latency-sensitive game interfaces, reduce or disable coalescing:

  • ethtool -c eth0 — read current coalescing settings.
  • ethtool -C eth0 rx-usecs 0 adaptive-rx off — minimize receive coalescing for the game interface.
  • Keep coalescing enabled on bulk/storage interfaces, where throughput matters more than microseconds.

Rebuild the interface’s queue with more combined channels if a single queue is saturating, and check the softnet statistics for dropped packets during peaks — hidden drops show up to players as exactly the kind of periodic spike you are trying to remove.

Separating Network Jitter From Simulation Jitter

Not every spike is a network problem. If client-side RTT is flat but players still report stutter, the variance is being generated inside the game process — a garbage-collection pause, a save write, or a physics burst. Compare client RTT jitter with server-side frame time. When RTT is steady and frame time is spiky, stop tuning the network and look at RAM pressure, disk IO, or core contention. Getting this split right saves days of chasing phantom network faults.

Leave a Reply