Qvantor logo QvantorInfrastructure, explained plainly
Guides

How to Trace Game Server Latency With mtr and iperf3

Four people on the voice call told me the server was lagging. One was rubber banding backwards every few seconds, one had a flat 180 ms ping that never moved, one got dropped from the session twice in ten minutes, and the fourth was fine...

A terminal window showing a network trace report beside a laptop running a multiplayer game server console

Four people on the voice call told me the server was lagging. One was rubber banding backwards every few seconds, one had a flat 180 ms ping that never moved, one got dropped from the session twice in ten minutes, and the fourth was fine until his roommate started a video call. Those are four different faults with four different fixes, and I spent most of a Saturday restarting a perfectly healthy Valheim server before I accepted that the server itself was innocent in three of the four cases.

This walkthrough is the order I follow now: measure the path with mtr, measure the pipe with iperf3, then look at the game process last. It takes about 40 minutes the first time and roughly six minutes once the commands live in your shell history. You need SSH access to the box, mtr and iperf3 on both ends, and one friend patient enough to run two commands while the problem is still happening rather than an hour later.

Split the word lag before you touch a config file

Lag is a feeling, not a measurement. Underneath it there are four separate numbers, and each one points somewhere else.

Round trip time is the delay. A steady 180 ms feels heavy but predictable, and players adapt to it within a match. Jitter is the variation in that delay, and it is what produces rubber banding: the client predicts where you are, packets arrive in a clump, and the server corrects you backwards. Packet loss causes missed hits and the sudden disconnects, because the game gives up waiting. Tick starvation is different from all three, a server too busy to simulate the world on schedule, and no amount of network work will fix it.

Ask the complaining player one question before anything else: is it constantly bad, or does it come in waves? Constant means distance or a routing problem. Waves mean congestion, usually inside their own home, and the time of day matters.

Baseline the path with mtr

A single ping tells you almost nothing. mtr sends a long series and shows every hop between the two machines, which is where the useful detail sits. From the player's machine, pointed at the server address, the run I ask for is 300 cycles:

mtr -rwzbc 300 $SERVER_IP

That is five minutes of sampling, long enough to catch an evening congestion pattern. The flags matter: -r gives a report instead of a live display, -w stops hostnames from truncating, -z shows the AS number so you can tell which network a bad hop belongs to, and -b prints both name and address. Run the same command in the other direction from the server. Routes are often asymmetric, and a problem that only shows on the return path is common enough that skipping this step has cost me two evenings.

Read the output from the bottom up. The final hop is what the game actually experiences. Loss shown on a middle hop with zero loss afterwards is almost always a router that deprioritises its own ICMP replies, not a real fault. I ignore any middle hop unless the loss continues to the end of the list. What I do care about is the last column: StDev on the final hop above roughly 15 ms is the signature of jitter, even if the average looks acceptable.

Why I stopped telling people to move the server closer

The standard advice is to pick a region nearer your players, and it is the first thing most hosting panels push. I have moved servers for this reason three times and regretted it twice.

Here is the arithmetic that changed my mind. Moving a server from Frankfurt to Amsterdam for a group spread across the Netherlands and Poland saved the Dutch players about 14 ms and cost the Polish players about 11 ms. Nobody noticed either change. What people did notice, badly, was the 2 to 3 percent packet loss one player had on a saturated upstream link, which produced the hit registration complaints that started the whole conversation. Loss and jitter dominate the experience; raw distance barely registers once you are inside a continent.

Migration also resets your evidence. New address, new route, new neighbours on the host. Move the server when mtr shows the route itself is bad across several days and several players, not because the ping number looks large next to someone else's screenshot.

Measure the pipe separately with iperf3

Latency and bandwidth are different problems and they need different tools. On the server, start a listener on a port you can reach:

iperf3 -s -p 5201

From the player's machine, a plain TCP test first, then a reverse test so you see their upload, which is the direction that usually hurts:

iperf3 -c $SERVER_IP -p 5201 -t 30 -R

Then the test people skip. Game traffic is UDP and thin, so hammering the link with TCP tells you the ceiling, not the behaviour. Run a modest UDP stream at a rate close to real game traffic and read the loss and jitter lines:

iperf3 -c $SERVER_IP -p 5201 -u -b 3M -t 60

A clean residential link gives under 0.3 percent loss and jitter under 2 ms on that test. A link that reports 8 percent loss at 3 Mbit while showing 90 Mbit of TCP throughput is the exact profile of a household where something else is filling the upstream queue. That is a router QoS conversation, not a server conversation.

Remember to stop the listener when you are finished. An open iperf3 port is a free bandwidth drain for anyone who scans for it.

Matching the symptom to the reading

This is the table I keep pinned in the server channel, built from the handful of cases I have actually traced rather than from theory.

What the player saysTool to runReading that confirms itWhere the fix lives
Everything feels heavy but consistentmtr from clientFlat average, StDev under 5 msNowhere. This is distance, accept it
I keep snapping backwardsmtr from clientStDev above 15 ms on final hopTheir home link or a congested transit hop
My hits do not landiperf3 UDPLoss above 1 percent at 3 MbitRouter queue, Wi-Fi, or upstream saturation
I get disconnected every few minutesmtr, 600 cyclesLoss spikes to 100 percent brieflyFlapping route or a dying cable
It is slow for all of us at onceServer side metricsTick time above the budget, high loadThe server, finally

Only now look at the server

If several players degrade at the same moment, the network is probably fine and the simulation is behind. Check the tick time your game exposes, usually in the console or an admin command, and compare it to the budget: a 20 tick server has 50 ms per tick, a 30 tick server has 33 ms. Anything consistently above that and clients receive stale state no matter how good the route is.

Watch load average and iowait while the game runs, not afterwards. Two causes account for nearly everything I have seen. The first is an autosave writing a large world file on a shared disk, which shows up as a jitter spike at a regular interval. The second is a mod or plugin doing per tick work that scales with the number of entities, which gets worse the longer a world lives. Both leave a rhythm in the data, and a rhythm is a strong clue. If you do not yet collect any of this, setting up Uptime Kuma for a small site gives you timestamped history cheaply, which turns a vague complaint into a window you can search.

A sane first week

Install mtr and iperf3 on the server tonight and run one 300 cycle report to each regular player, labelled with the date. Ask two of them to do the same in reverse. That is your baseline, and it costs twenty minutes of attention. Next time someone says the server is lagging, you will have a number from a day when it was not.

One honest limit: none of this diagnoses the game client. If one player has stutter that no mtr or iperf3 reading explains, it is their frame pacing or their drivers, and I have no good remote test for that. More context on why these numbers matter at all sits in why low latency matters so much to online game players, and the practical side for players is in keeping sessions stable when a connection wobbles.

FAQ

Can I use ping instead of mtr?

For a quick yes or no, sure. Ping gives you an average and a loss figure for one endpoint. It cannot tell you which hop introduced the problem or whether the return path differs, and most interesting faults live in those two details.

Why does mtr show 40 percent loss in the middle and none at the end?

Many routers rate limit the ICMP responses mtr relies on, so they report loss they are not actually causing. Only loss that continues through every hop to the destination counts.

Does a higher tick rate fix rubber banding?

Rarely, and it can make things worse. Raising tick rate increases both CPU use and the number of packets sent, so on a loaded box or a congested link you trade one problem for a bigger one. Fix jitter and loss first, then consider tick rate.

How long should I run a UDP iperf3 test?

Sixty seconds is enough to see a steady problem. If the complaint only appears in the evening, schedule the same 60 second test hourly for a day instead of running one long test, because the pattern tells you more than the peak figure.

MQ
Marisa Quan

Marisa hosts game servers for her friends and writes about latency, uptime and the people who keep servers alive.

More posts by Marisa

More in Guides

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp foxstudiosscratch gamevui123 gleasongrade greetingsday hacklabasu haskell iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot skrtips spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr webtech1223411 wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto