Skip to content

Lesson 2 of 9 · 26m

Lag Is a Symptom: TPS, MSPT, and Evidence

Learn the difference between tick rate, tick duration, network latency, and client FPS, then use spark and timings to isolate the real bottleneck.

Players say "lag" when a boat rubber-bands, when chunks load slowly, when their own frame rate drops, and when a hundred zombies cook a server alive. Four different failures share one word. The first operator skill is translation: convert complaints into measurements before touching configuration.

Separate the four kinds of lag

Server tick lag means the server cannot complete work in 50 milliseconds per tick. Network latency means packets take too long or arrive unevenly. Client lag means the player's machine cannot render or simulate its own view fast enough. Disk stalls mean the server waits on storage and often appears as periodic freezes. Treating all four as "low TPS" produces random changes and ritual sacrifice.

Useful vocabulary:

TPS   ticks per second; 20 is ideal
MSPT  milliseconds per tick; above 50 means ticks cannot keep up
ping  network round-trip time, not server processing time
FPS   client rendering rate, mostly outside server control

A server can hold 20 TPS while a player in another country has 220 ms ping. It can also show acceptable average TPS while sharp MSPT spikes freeze everyone every few seconds.

spark is the modern microscope

Install spark from its official distribution, then gather evidence during the actual lag window:

/spark tps
/spark healthreport
/spark profiler --timeout 60
/spark tickmonitor

A profiler report shows where thread time went: entity ticking, chunk generation, hopper movement, pathfinding, plugin event handlers, or world saving. Read the tree. A plugin at the top of a report is a suspect, not automatically a villain; it may simply be reacting to thousands of entities someone else spawned.

Timings still teach useful structure

Paper's timings commands can expose high-level event and task costs:

/timings on
/timings report
/timings reset

Timings is coarse and can mislead small-sample administrators. Use it for patterns: repeated expensive event handlers, runaway scheduler tasks, and plugins doing synchronous work on the main thread. Do not use a thirty-second sample during spawn login as proof of an all-day problem.

Pregenerate before blaming chunk loading

New-world exploration creates chunks synchronously enough to hurt. Pregenerate the expected playable area with Chunky:

/chunky center 0 0
/chunky radius 2500
/chunky start

Then cap or police the farms that generate the real load. A hundred skeletons is atmosphere; five thousand entities in one farm is an outage with a name tag.

Field notes

  • Record MSPT and profiler output before changing config; otherwise you will never know what fixed what.
  • Garbage collection appears in server symptoms, but GC is not always the root cause of tick work.
  • ATPS averages can hide alternating fast and stalled ticks; inspect percentile behavior when available.
  • Never troubleshoot production only by restarting. A restart may clear evidence without clearing cause.

Was this lesson helpful?

Sign in to rate