- Home
- Fix server lag
Fix Minecraft server lag at the cause.
Turning the view distance down makes nearly any server faster, and usually means the real cause never gets found. This guide is about finding what is actually eating your tick: an entity pile-up, chunk generation, a plugin, or memory.
First: is it the server?
“Lag” means three different problems, and only one of them is fixed on the server.
| What players see | What it is | Where to look |
|---|---|---|
| Blocks come back after breaking, mobs freeze, everyone rubber-bands at once | Server lag: TPS below 20 | This page |
| One player rubber-bands, the rest are fine | That player’s connection | Their ping, not your configs |
| Stuttering camera, low FPS | Client lag | The player’s own settings and mods |
Measure it: TPS and MSPT
A Minecraft server aims for 20 ticks per second, which gives each tick 50 milliseconds. MSPT (milliseconds per tick) is how long ticks are actually taking. Below 50 and TPS holds at 20. Above 50 and TPS drops, and players feel it.
On Paper or Spigot, run /tps. On Paper, /mspt as well. The
server log also tells you when it is falling behind:
[Server thread/WARN]: Can't keep up! Is the server overloaded? Running 4012ms or 80 ticks behind
The occasional one of these at startup is normal while the world loads. Regular ones during play mean something is taking more than its 50ms.
Find the cause with spark
spark is the standard profiler. Paper ships with it built in from 1.21; on Spigot, install the plugin. Start a profile while the lag is happening:
/spark profiler start --timeout 120
After two minutes spark prints a link to a report. Open the Server thread
and expand the biggest branches. The name that keeps coming up (a plugin’s package,
an entity type, chunk generation) is your lag. /spark health gives a quick
summary of TPS, MSPT, CPU and memory without a full profile.
The usual causes, and what fixes them
Too many entities
Mob farms, villager halls, dropped items and piles of minecarts. Each entity costs work
every tick. Count them where the lag is, and fix the build before you change the
settings: a farm that stacks 300 cows in one chunk will lag at any setting. After that,
entity-activation-range and merge-radius in
spigot.yml, and spawn-limits in bukkit.yml, cut the
load without players noticing.
Chunk generation
Players exploring new land make the server generate terrain as they go, one of the most expensive things it does. Pre-generate the world out to your border with a plugin like Chunky, and set a world border so it stays done.
View and simulation distance
In server.properties, view-distance is how far players can see
and simulation-distance is how far the world actually ticks. Lowering
simulation distance saves a lot while players still see far. It is often the right
trade, just not the first thing to reach for.
Redstone and hoppers
Large hopper chains and constantly running clocks add up. On Paper,
config/paper-world-defaults.yml has hopper settings that make them cheaper
to run. Check the spark report before blaming them; they show up clearly if they are
the problem.
A plugin
If one plugin’s package dominates the spark report, that is the answer. Update it, fix its config (a scheduled task running every tick is common), or replace it. A plugin that errors in the log on every tick lags too, even if it looks fine.
Memory
If lag comes in regular spikes and heap use sits near the maximum, the server is spending its time on garbage collection. Give it enough memory, but not everything the machine has, and use a well-tested set of JVM flags such as Aikar’s.
How Conny works through it
Tell Conny “the server is lagging” and it does the same investigation on your server:
- Reads TPS, memory use and who is online.
- Reads
logs/latest.logfor “Can’t keep up” warnings and for plugins throwing errors. - Lists your plugins, including any that failed to enable.
- Runs console commands such as
/spark healthand reads the output. - Reads your
server.properties,spigot.yml,bukkit.ymland Paper configs, and changes the setting that matters, with your approval. - Checks the numbers again afterwards, so you know whether it helped instead of taking its word for it.
Let Conny find your lag
Connect your server, say what’s happening, and Conny reads the logs and configs to find the cause.
Works with any host that gives you SFTP access.Questions
Why is my Minecraft server lagging with few players online?
Player count is rarely the cause. A server with three players can lag from a mob farm, a hopper-heavy base, chunk generation as someone explores, or a plugin doing heavy work every tick. A spark profile shows which one it is.
What is a good TPS for a Minecraft server?
20 TPS is the maximum and the target. Each tick then has 50 milliseconds, so MSPT below 50 means the server is keeping up. Sustained TPS below about 18 is where players start to notice.
What does "Can't keep up! Is the server overloaded?" mean?
The server fell behind, so a tick took longer than its 50 milliseconds and the game is skipping ahead to catch up. A few at startup are normal. Regular ones during play mean something needs fixing, and a spark profile will show what.
Does lowering view distance fix lag?
It reduces the load, which is why it is the standard advice, but it rarely fixes the cause. Lowering simulation-distance usually saves more while players keep seeing far. Find what is using the tick first, then decide.
Can AI fix Minecraft server lag?
Conny can do the investigation on your server: read TPS and memory, the log and your configs, find the entity, chunk or plugin at fault, change the setting with your approval, and check the numbers again afterwards.