Which kind of lag is it?
| What you see | What it is | Where to look |
|---|---|---|
| Blocks reappear, mobs freeze, everyone lags at once | Server lag (low TPS) | The server |
| Only you rubber-band, others are fine | Ping: your connection | Your network |
| The game stutters, even in single player | Low FPS: your computer | Your graphics settings |
Measure it
A server runs 20 ticks per second (TPS). At 20 everything is smooth; below about 18 you start to notice it. On Paper, type in the console:
tpsTo find the cause, install spark and run a profiler while the lag happens. Its report shows exactly what takes the time.
spark profiler startspark profiler stopOn a Max Hosting server, press the lag button in Munin, the AI assistant: it measures TPS, runs spark and counts entities for you, and says what to change.
The usual causes and their fixes
- View and simulation distance too high. Every chunk around every player is loaded and run. Lower the view distance to 8 and the simulation distance to 6 on the Settings tab; few players notice.
- New land being generated. Exploring generates chunks, which is heavy. Pre-generate the world with Chunky and set a world border.
- Too many entities. Big mob farms, thousands of items on the ground, villager halls. spark shows them; limit farm sizes and clear item drops.
- Redstone clocks and hoppers. Clocks that never stop and long hopper chains run every tick.
- A slow plugin. spark names it. Update it or replace it.
- Vanilla instead of Paper. Paper runs the same game much faster. On Max Hosting you switch on the Version tab.
Is it memory?
Lag that gets worse over hours, java.lang.OutOfMemoryError in the console, or a server that stops by itself means it needs more memory than it has. Remove heavy mods, lower the view distance, set a daily restart on the Schedule tab, or upgrade the plan; upgrading keeps everything.
"Can't keep up! Is the server overloaded?" in the console means the server fell behind on ticks: it's the same lag, and the causes above apply.
If it's ping
Ping is the time to the server and back. It depends on the distance and your connection. A server close to the players helps most: Max Hosting's servers are in Helsinki, which gives low ping across Sweden, Finland, Norway and Denmark. Wi-Fi far from the router and downloads on the same network add to it.
