Skip to content

Fix lag

There are two kinds of lag. Server lag makes everything slow down: mobs freeze, blocks come back after you break them, and the whole world feels heavy. Connection lag is your own ping: other players move fine on their screens, but you rubber-band.

On Paper, Purpur and Leaf, run tps in the console. The server runs at 20 ticks per second. If the number is close to 20, the server is fine and the lag is on the connection. If it’s well below 20, the server is lagging.

To find out what’s slow, use spark. It’s built into Paper 1.21 and newer. On other software, install the spark plugin or mod first. Run spark profiler start, wait a minute while the lag happens, then run spark profiler stop. It gives you a link that shows which plugins, entities or chunks use the most time.

These help most, roughly in order:

  • Use Paper, Purpur or Leaf. They’re much faster than Vanilla. See change the software.
  • Pre-generate the world. Generating new chunks is the heaviest thing a server does. Install the Chunky plugin and run chunky radius 3000, then chunky start, while nobody is online.
  • Lower the view distance. In server.properties, set view-distance to 8 and simulation-distance to 6. Players see a bit less far, and the server does much less work.
  • Limit entities. Big mob farms and piles of dropped items cost a lot. Check the spark report for the worst spots.
  • Remove plugins you don’t use. Every plugin costs a little, and a few cost a lot.
  • Try another performance profile. On the Startup tab of Settings, try Aikar’s G1GC. See startup settings.
  • Upgrade the plan. More memory and CPU help modpacks and big player counts. See plans.

Restart the server after changing server.properties or the profile.

You can also ask Byte: “Optimize my server settings to reduce lag.”

If TPS is fine but you lag:

  • Close downloads and streams on your network, and use a cable instead of Wi-Fi if you can.
  • Turn off VPNs.
  • Check whether other players lag too. If only you do, it’s your connection.