Home/Minecraft guides/How to fix Minecraft server lag

How to fix Minecraft server lag

Most lag has one or two causes you can find in ten minutes. Work out which kind of lag you have, measure it, and fix the thing that's actually slow.

Short version
  1. Check TPS. If it's 20 but players still rubber-band, it's network lag, not the server.
  2. If TPS is below 20, run /spark profiler to see what's eating the tick.
  3. The usual culprits: chunk generation, too many entities, big farms and redstone, too-high view distance, a bad plugin or mod.
  4. Use Paper (or Fabric with Lithium), pre-generate the world, set view distance 8–10 and simulation distance 6–8.

1. Work out which kind of lag you have

SymptomLikely cause
Everyone rubber-bands, blocks reappear after breaking, mobs freezeServer lag (low TPS)
One player lags, everyone else is fineThat player's connection or PC
Low FPS, stuttering when turningClient lag. Nothing to do with the server.
Short freezes every few seconds or minutesGarbage collection pauses, autosaves or a scheduled task
Lag only when exploring new areasChunk generation

2. Measure TPS and MSPT

Minecraft runs 20 ticks per second, so each tick has a 50 ms budget. TPS (ticks per second) drops below 20 when ticks take longer than that. MSPT (milliseconds per tick) shows how close you are: a server at 20 TPS with 45 MSPT is about to lag; one at 15 MSPT has lots of headroom.

  • Paper and Purpur: /tps and /mspt.
  • Any server with the spark plugin or mod: /spark tps and /spark health (which also shows memory and garbage collection).
  • On NS5, the Metrics tab graphs TPS, tick time, players, CPU and memory over the last hour, six hours or day, so you can see when lag started and what it lines up with.

3. Find the cause with spark

Guessing wastes hours. spark tells you exactly what's using the tick.

  1. Install spark (Paper has it built in on recent versions; otherwise get it from Modrinth).
  2. While the server is lagging, run /spark profiler start.
  3. Wait 2–5 minutes, then run /spark profiler stop. It gives you a link to a report.
  4. Open the report and expand the server thread. Look for the biggest percentages: a plugin or mod name, entityTick, chunk generation, or block entities such as hoppers.

4. Fix the common causes

Chunk generation

Generating new terrain is one of the most expensive things a server does. Pre-generate the world before players explore it with the Chunky plugin or mod, for example /chunky radius 5000 then /chunky start, and set a world border slightly smaller with /worldborder set 10000. Run it overnight or before launch. Elytra flight into new chunks is a classic lag source on servers without pre-generation.

View distance and simulation distance

In server.properties, view-distance controls how many chunks are sent to players and simulation-distance controls how far away things keep ticking. View distance 8–10 with simulation distance 6–8 is a good balance. Dropping simulation distance from 10 to 6 cuts the area that ticks around each player by more than half.

Entities

Thousands of mobs, item frames, armour stands, minecarts or dropped items will tank TPS. Check counts with spark or /minecraft:kill @e[type=item] for dropped items in an emergency. Limit huge animal pens, and on Paper use the entity-per-chunk-save-limit options and spigot.yml's entity-activation-range to stop distant mobs ticking every tick.

Farms, hoppers and redstone

Big automatic farms, hopper chains and redstone clocks run every tick. Ask players to switch farms off when not in use, replace long hopper chains with water streams where possible, and on Paper consider the hopper settings in paper-world-defaults.yml.

A bad plugin or mod

If spark points at a plugin or mod, update it, check its config for something like a short-interval task, or remove it. Dynamic map plugins rendering the whole world are a common one; let them render once and then limit it.

Use faster server software

Vanilla is the slowest option. Paper or Purpur for plugin servers, or Fabric with Lithium and FerriteCore for Vanilla-style or modded servers, often doubles the headroom. See Paper vs Fabric vs Forge.

Java and garbage collection

Freezes every few minutes often come from garbage collection. Run a current Java (21 for modern versions) and use well-tested JVM flags such as Aikar's flags. Our startup command generator writes them for you. Set -Xms equal to -Xmx.

5. When it's the hardware

Minecraft's main game loop runs on one thread, so single-core speed matters more than core count. If spark shows nothing unusual, MSPT is high with a few players, and your memory isn't full, the CPU may simply be too slow or oversubscribed. On a shared host that sells "unlimited" plans, your server may be fighting for CPU with many others.

NS5 runs every server on AMD EPYC data-centre CPUs, with RAM reserved for your server and CPU that scales with your plan. If you outgrow your plan, resize from the panel in seconds.

6. When it's the network

If TPS is a steady 20 but players lag, check their ping in the tab list. High ping comes from distance or the player's own connection. Pick a server location central to your players: NS5's servers are in Chicago, which keeps ping reasonable across North America. You can test your ping to us from your browser.

Common questions

What is a good TPS for a Minecraft server?

20 TPS is perfect and the maximum. Anything consistently below about 18 is noticeable. MSPT under 40 means you have room to spare.

Will more RAM fix my lag?

Only if memory is actually full. Most lag comes from the CPU having too much to simulate each tick, which more RAM doesn't fix.

Why does my server lag when people explore?

Generating new chunks is expensive. Pre-generate your world with Chunky and set a world border so exploring only loads existing terrain.

Run it on NS5 instead

Minecraft Java servers from $3.70/month on AMD EPYC with dedicated RAM. One-click Paper, Fabric, Forge and Modrinth modpacks, backups and SFTP included. Try one free for 48 hours, no card needed.