Skip to content

Game servers

How to diagnose and fix Minecraft server lag

TPS, ping or FPS? Find the real cause of Minecraft server lag with spark, then fix farms, chunk generation, configs and plugins.

"The server is lagging" is the most common complaint any Minecraft admin hears, and it can mean three completely different things. Before you change a single setting, find out which kind of lag you actually have. Guessing wastes hours and often makes things worse, like adding RAM for a problem that has nothing to do with memory.

Three kinds of lag

TypeWhat players seeWhere the problem isHow to check
Server lag (low TPS)Blocks reappear after breaking, mobs freeze then teleport, farms slow down, everyone is affected at onceThe server cannot finish its work in time/tps, /mspt, /spark tps
Network lag (high ping)Rubber-banding, delayed hits, late chat, usually only for some playersThe connection between the player and the serverPing in the tab list, /spark ping
Client lag (low FPS)Choppy picture, stutter when turning, everything else behaves normallyThe player's own computerF3 debug screen, FPS counter

A quick rule: if everyone lags at the same moment, it is the server. If one player lags, it is their connection or their PC. If the world behaves correctly but the screen is choppy, it is the client, and no server setting will fix it. Point those players at Sodium or a lower render distance instead.

Understanding TPS and MSPT

Minecraft runs on a fixed loop of 20 ticks per second. Every tick, the server moves entities, grows crops, updates redstone, processes chunks and handles player actions. To keep up, each tick must finish within 50 milliseconds.

  • TPS (ticks per second) tells you whether the server keeps up. 20 is perfect. Anything below about 19 is noticeable, and below 15 players will complain.
  • MSPT (milliseconds per tick) tells you how much headroom you have. A server at 20 TPS with 45 MSPT is one busy farm away from lagging, while one at 20 TPS with 12 MSPT has plenty of room.

MSPT is the more useful number. TPS is capped at 20, so it hides problems until they are already bad. Watch MSPT during peak hours and you will spot trouble before players do.

Step 1: profile with spark

spark is the standard performance profiler for Minecraft servers. It ships with recent Paper builds and is available as a plugin or mod for Spigot, Fabric, Forge and NeoForge. It samples what the server is doing and shows exactly which code, plugin or entity type is eating your tick time.

Start with a health check

/spark tps
/spark health
/spark gc

/spark tps shows TPS and MSPT averages over several time windows. /spark health adds CPU usage, memory and disk. /spark gc shows garbage collection activity: long or frequent pauses point at a memory problem, while short pauses with high MSPT point at too much work per tick.

Run a profile while the lag happens

/spark profiler start
# wait 3 to 5 minutes while the server is busy
/spark profiler stop

spark uploads the result and gives you a link to an interactive viewer. Profile when the lag actually happens, with players online. A profile of an empty server at 4 AM tells you nothing.

If the lag comes in spikes rather than all the time, record only the slow ticks:

/spark profiler start --only-ticks-over 100

This keeps only ticks that took longer than 100 ms, so the spikes are not drowned out by thousands of normal ticks.

Reading the result

Open the viewer, expand the Server thread and follow the branches with the highest percentage. Common things you will find:

  • Entity ticking (tickEntities, entity tick lists): too many mobs, items or other entities. See the entity section below.
  • Chunk generation or loading (worldgen and chunk system classes): players exploring new terrain. Pre-generation fixes this.
  • Block entities and redstone (hoppers, pistons, observers): farms and contraptions.
  • A plugin's package name high in the tree: that plugin is your culprit. The viewer can group results by plugin to make this obvious.

Step 2: find entity and farm hotspots

Entities are the single biggest cause of server lag. One player's 400-cow breeding pen or an overflowing item farm can drag down the whole server. On Paper you can find crowded chunks quickly:

/paper entity list
/paper entity list minecraft:item

This lists entity counts per type and the chunks with the most of them. Teleport there and look. Typical offenders:

  • Animal pens with hundreds of cows, sheep or chickens. Each one pathfinds and collides with its neighbours.
  • Item farms that never get emptied, leaving thousands of dropped items on the ground.
  • Villager trading halls. Villagers are among the most expensive mobs because of their pathfinding and job-site logic.
  • Mob farms with nowhere to send mobs, so they pile up.
  • Long hopper chains under every farm. Each hopper checks for items constantly.
  • Redstone clocks left running in a forgotten corner that is kept loaded by spawn chunks or a chunk loader.

Talk to the player before deleting anything. Often a simple fix, such as adding a kill chamber, replacing hoppers with water streams, or putting a clock on a lever, solves it without anyone losing their build.

Step 3: tune view and simulation distance

In server.properties there are two separate settings, and many admins only know about one:

view-distance=10
simulation-distance=6
  • view-distance is how far chunks are sent to players. It mostly costs bandwidth and memory.
  • simulation-distance is how far around each player the world actually ticks: mobs move, crops grow, redstone runs. This is what costs CPU.

Lowering simulation distance from 10 to 6 cuts the ticked area around each player by roughly 60 percent, while players still see just as far. It is often the biggest single win on a busy server.

Step 4: Paper and Purpur config tweaks

If you run vanilla or plain Spigot, switching to Paper is the most effective performance change you can make. It is a drop-in replacement that keeps your world and Spigot plugins. Purpur builds on Paper and adds even more options.

World settings live in config/paper-world-defaults.yml. A few settings worth reviewing:

chunks:
  entity-per-chunk-save-limit:
    arrow: 16
    experience_orb: 16
    snowball: 8
collisions:
  max-entity-collisions: 2
environment:
  optimize-explosions: true
  treasure-maps:
    find-already-discovered:
      loot-tables: true
      villager-trade: true
hopper:
  disable-move-event: false
  ignore-occluding-blocks: true
misc:
  redstone-implementation: ALTERNATE_CURRENT
tick-rates:
  grass-spread: 4
  mob-spawner: 2

What these do:

  • entity-per-chunk-save-limit stops chunks from saving hundreds of arrows or XP orbs, which otherwise come back and lag the chunk every time it loads.
  • max-entity-collisions limits how many collisions each entity checks per tick. Lower values help crowded pens a lot, but test entity-cramming farms afterwards.
  • optimize-explosions makes TNT and creeper explosions much cheaper to calculate.
  • find-already-discovered stops treasure maps from searching huge areas for an undiscovered structure, a well-known source of large spikes.
  • redstone-implementation set to ALTERNATE_CURRENT or EIGENCRAFT makes redstone dust far cheaper. Test important contraptions afterwards, as some timing-sensitive builds can behave differently.
  • ignore-occluding-blocks skips item checks for hoppers covered by full blocks. Only set disable-move-event to true if no plugin needs hopper events, since protection plugins often do.
  • tick-rates slows down grass spread and spawner checks. Most players will never notice.

In spigot.yml, entity-activation-range controls how far from players mobs are fully ticked, and merge-radius controls how aggressively dropped items and XP orbs merge. Raising the item merge radius a little helps busy farms. In bukkit.yml, lowering spawn-limits reduces the total number of naturally spawned mobs.

Change one group of settings at a time, restart, and compare MSPT against your earlier spark results. That way you know what helped and can roll back whatever broke a farm.

Step 5: pre-generate your world

Generating new chunks is one of the most expensive things a server does. When several players fly with elytra in different directions, chunk generation alone can push MSPT well past 50. The fix is to generate the world before players need it.

Install the Chunky plugin and set a world border so players cannot leave the generated area:

/worldborder center 0 0
/worldborder set 10000
/chunky world world
/chunky center 0 0
/chunky radius 5000
/chunky start

Run it while the server is quiet, for example overnight. A 5000-block radius takes a while, and /chunky progress shows how far along it is. Repeat for world_nether with a smaller radius (one eighth of the overworld matches portal scaling) and for world_the_end if players explore it. Pre-generated worlds take more disk space, so check your storage first.

Step 6: check your plugins

If spark points at a plugin, you have found your answer. Even when it does not, a few plugin habits cause lag again and again:

  • Outdated plugins built for older Minecraft versions, especially ones that do heavy work on the main thread.
  • Plugins that save data on the main thread, causing a spike every few minutes when they write to disk or a database.
  • Scoreboard, hologram and tab list plugins that update every tick for every player.
  • Duplicate functionality, such as two anti-cheat or two protection plugins doing the same checks.
  • Mob stacking and clear-lag plugins with poor settings. They can help, but a "clear all items every 60 seconds" timer causes its own spike and annoys players. Fix the farms instead where you can.

To confirm a suspect, disable it on a test copy of the server, or temporarily on the live one, and profile again. Compare like with like: the same number of players at the same time of day.

When it is the network or the client

If TPS is a steady 20 and MSPT is low but players still complain, look elsewhere:

  • High ping for everyone usually means the server is far from most players. Hosting close to your community matters more than any config tweak.
  • High ping for one player is their Wi-Fi, ISP or VPN. Ask them to try a wired connection.
  • Low FPS is the player's PC. Lower render distance, fewer resource packs and performance mods like Sodium help.
  • Stutter when joining or teleporting can be a view distance set too high, sending a lot of chunk data at once.

When it is time to upgrade

Minecraft's main tick loop runs mostly on a single CPU core, so per-core speed matters more than core count. If spark shows tick time spread across normal gameplay with no single culprit, MSPT stays high with a reasonable player count, and you have already worked through the steps above, the server needs a faster CPU. More RAM will not help a CPU-bound tick loop, and far too much can even lengthen garbage collection pauses.

Our Minecraft RAM calculator shows how much memory your setup should need, so you can check whether an upgrade will actually help.

Zettako's Premium Minecraft plans use faster processors and DDR5 memory for busy servers and heavy modpacks. Whatever plan you are on, start with a spark profile: it turns "the server lags" into a specific problem you can fix.

Need more headroom?

Premium Minecraft servers with faster processors and DDR5 memory. Open a ticket if you want help reading a spark profile.

Starting at £5.95GBP/mo