Minecraft server lag: how to raise TPS
Find out whether the server or the connection is slow, then work through the fixes from cheapest to most expensive. More RAM comes last.
First find out whether the server is slowing down or your connection is. Then go through the list from the cheapest changes to the most expensive. Adding memory is last on that list, not first.
TPS: what lag is measured in
A Minecraft server calculates the world twenty times per second. That number is TPS, and twenty is the maximum. When it drops, time in the game slows down: mobs move in jumps, blocks appear with a delay, furnaces work slower.
On Paper you check it with /tps, in the console or in the game. Read the result like this:
| TPS | What it means |
|---|---|
| 20.0 | everything is fine |
| 19 to 20 | small fluctuations, players do not notice |
| 15 to 19 | noticeable delays, time to act |
| below 15 | the game gets tiring |
If TPS holds at twenty and it still "lags", the problem is not on the server but in the connection or the player's client. People tend to mix those two up.
Start with the view distance
This one setting does more than all the others combined. In server.properties:
view-distance=8
simulation-distance=6
The default ten and ten means the server keeps and calculates a huge area around every player. Going down to eight and six can take a third of the load off, and in the game you only notice the difference when someone stands on a mountain top staring at the horizon.
The simulation distance matters more than the view distance: it decides within what radius mobs think, crops grow and machines run. All the other settings are explained in server.properties explained.
Mobs and items on the ground
The second most common cause is a crowd of entities. A farm with five hundred zombies waiting, or a thousand dropped items in one spot, can eat more time than all the players together.
In the Paper configuration (config/paper-world-defaults.yml) it is worth lowering the entity activation ranges, for example for monsters and animals, and shortening the time after which dropped items disappear. Players barely notice these changes, and the server gets room to breathe.
In server.properties itself, a sensible max-entity-cramming also helps.
Generating the map on the fly
When a player walks into unexplored terrain, the server creates the world on the spot, and that is one of the heaviest things it does. It shows up as stutters exactly when someone sets off on an expedition.
The fix: generate the map in advance with the Chunky plugin and set a world border. The server then does the heavy work once, in peace, instead of in the middle of a session. How to do it step by step is in Chunky: pregenerating the world.
Stop guessing, measure
Instead of turning things off one by one, install spark and, when TPS drops, type:
/spark profiler start
/spark profiler stop
You get a link to a report that shows what exactly takes up the tick time: a specific plugin, a specific mod, terrain generation or entity handling. Five minutes with the profiler saves an evening of guessing.
When it is memory and when it is the CPU
The graphs on the Dashboard answer that faster than any command.
- Memory at the ceiling, CPU calm: the server is short of RAM and spends most of its time cleaning up. See How much RAM does a Minecraft server need.
- CPU at the ceiling, memory to spare: a plan with more RAM will not help. Look for the cause in entities, map generation or one heavy add-on.
- Both calm, and it is still slow: check whether the problem is on the player's client. Minecraft calculates the world mostly on one core, so the overall CPU load can be misleading.
Modpacks play by their own rules
With tech packs, lag often comes not from the number of players but from one automation running nonstop. What helps then is stopping machines from keeping chunks loaded when nobody is nearby, or limiting the number of loaded chunks.
Lower the view distance more boldly here than on a plain server: modpacks are clearly more sensitive to it.
The order of steps, cheapest first
- Lower
view-distanceandsimulation-distance. - Check whether a crowd of mobs or items has built up somewhere.
- Pregenerate the map and set a world border.
- Run the profiler and find the specific culprit.
- Only now move to a plan with more RAM, if the graphs really justify it.
Common questions
How do I check TPS on a Minecraft server? On Paper, Purpur and Spigot with /tps in the game or in the panel console. Twenty means full speed, values below fifteen are clearly noticeable.
Will more RAM fix low TPS? Only if memory is actually running out. If the graph has headroom, the cause is the CPU, entities or a specific add-on, and more memory changes nothing.
What should view-distance be? Eight is a good starting point for a server with friends, six for a modpack. Set the simulation distance two lower than the view distance.
The server has twenty TPS but it still stutters for me. Why? Because it is not the server slowing down but your connection or game client. Check your ping and frame rate before you start changing server settings.
If you need a stronger machine, see our Minecraft server hosting.