Find out why your server lags
My server lags. Where do I even start?
Measure first: check TPS, MSPT, memory and CPU, then use a profiler (spark) to see exactly what is slow.
Before you start: A Paper, Purpur or Fabric server (for /tps and spark), and a laggy moment to measure.
Step by step
- In game or console, run tps (Paper/Purpur). 20 is perfect; under 18 players feel lag.
- Run mspt: under 50 ms per tick is healthy; above 50 means the server cannot keep up.
- Open Statistics in the panel: memory near 100% points to RAM; CPU at the plan limit points to CPU.
- Install spark from the Plugins tab (or the Fabric mod) and run spark profiler start, wait 2 to 5 minutes while it lags, then spark profiler stop.
- Open the link spark prints. Expand the heaviest entries: entity ticking, a specific plugin, chunk generation or redstone will stand out.
- Fix the biggest item using the matching guide here (entities, farms, view distance, pre-generation, a plugin), then measure again.
- If only one player lags and TPS stays 20, it is their connection, not the server.
Check it worked: TPS stays at 20 and MSPT under 50 during your busy time.
Why it happens: Lag is either server lag (low TPS: everyone rubber-bands) or network lag (high ping: one player), and each has different fixes.
If spark shows nothing heavy but TPS is still low, send support the spark link.
More guides on RAM, CPU, performance, and lag: