TPS and lag: what is actually slow?

Server lag, client lag and network lag are three different things. How to tell them apart in two minutes, and what the Performance card in the console shows.

2 min readDiese Anleitung auf Deutsch lesen

On this page 4
  1. Three kinds of lag
  2. Read the numbers
  3. The Performance card in the console
  4. The usual suspects, in order

A Minecraft server runs 20 ticks per second; each tick has 50 ms of budget. When the work takes longer, TPS drops below 20 and everything on the server slows down: mobs stutter, blocks reappear, doors lag. That is server lag.

Three kinds of lag

SymptomKindCheck
Everything slow for everyone, blocks come back after breakingServer (TPS)tps in console shows below 19
Low frames, choppy picture, but chat and other players are fineClient (FPS)the player's F3 screen
Rubber-banding, delayed chat, one player onlyNetwork (ping)that player's ping in the tab list

Read the numbers

Type tps in the console (Paper). 20.0 20.0 20.0 is perfect. Also useful: mspt (milliseconds per tick); under 50 is the goal, 30 leaves headroom.

The Performance card in the console

On Minecraft Java servers (not on Velocity or BungeeCord) the console in the server management shows the Performance card. It shows how busy the server's main thread is, the thread that works through the ticks, and sums it up in one state: Running great, Running well, Could run better or Noticeable lag. It does not show a TPS number; for that, tps in the console still works. The card appears only after 5 minutes of uptime and shows a countdown until then.

If the server is not running smoothly, the card offers Optimize with Kowalski. Kowalski then checks the settings (view-distance, simulation-distance, Paper and Spigot configs), the plugins, the RAM and the logs, suggests changes and applies them. Or it hunts for the cause with you using spark. It asks you before it deletes or changes anything in your worlds.

The usual suspects, in order

  1. View distance too high: the single biggest lever. See players and view distance.
  2. Too many entities: mob farms, item drops on the floor, animals in a small space. /minecraft:kill @e[type=item] clears dropped items instantly.
  3. Chunk generation: players exploring new terrain. Pre-generate the world once.
  4. A plugin or mod doing too much every tick. Spark tells you which.
  5. Not enough RAM: the server spends its time in garbage collection. Console shows long GC pauses; upgrade.

Next: Read a Spark report.

Still stuck?

Kowalski, the assistant in your dashboard, reads your server's log and fixes most things on request. For everything else there is the ticket system.