How to Fix Minecraft Server Lag: TPS, MSPT, Profiling and the Settings That Matter
Tell client, server and network lag apart, read TPS, MSPT, spark reports and latest.log warnings, then fix the usual causes: entities, mob caps, hoppers, redstone, random ticks, chunk generation and view distance.
ChunkPod Team · · 37 min read
Most server lag has one or two specific causes: a farm, a hopper wall, players generating new terrain, a plugin doing slow work on the main thread, or settings that ask the server to tick more of the world than it can handle. Fixing it goes in three steps. First confirm the lag is actually on the server, then measure where the tick time goes, then change the thing the measurement points at.
This guide follows that order. It covers Java Edition, with most config examples for Paper and Spigot, and notes for Fabric where they differ.
Client lag, server lag or network lag?
Players use "lag" for three different problems, and each one has its own number.
| Type | Where it happens | Number to check | Who is affected |
|---|---|---|---|
| Client lag | The player's computer | FPS (F3 screen) | One player |
| Server lag | The server process | TPS and MSPT | Everyone at once |
| Network lag | The connection between them | Ping and packet loss | One player, or players in one region |
Client lag
The player's PC can't draw the game fast enough. The whole screen stutters, including the camera and menus, it gets worse when looking at big builds or farms, and nobody else notices. The FPS counter on the F3 screen drops into the teens when it happens. The causes (render distance too high, shaders, heavy resource packs, client mods, old drivers) are all on the player's side. Lowering the server's view distance for everyone is the wrong fix for one weak PC.
Server lag
The server can't finish its work on time, so the world itself runs slower than real time. Signs:
- Mobs move in slow motion or jump short distances instead of walking.
- Crops, furnaces and farms run slow, and the day stretches out.
- Blocks come back after being broken, and doors open a beat late.
- Players get pulled back a few blocks after moving (rubber-banding).
- It hits everyone online at the same moment.
A player with smooth, high FPS who sees the world in slow motion is looking at server lag. Their client is drawing frames fine. It just has nothing new to draw.
Network lag
Both machines are fine, but data between them is slow or getting lost. Hits register late, other players jump between positions, chat arrives in clumps, and rubber-banding comes in bursts. FPS stays normal, and usually only one player (or a few on the same home network or in the same region) is affected.
The signal bars in the tab list give a rough read on ping: one player with one or two bars while everyone else has full bars is a strong hint. Wi-Fi, other traffic on the same home network and VPNs are the usual causes. If every player's ping rises at once, either the server's connection is the problem or the server is too overloaded to respond, and MSPT tells you which.
Symptoms that overlap
- Rubber-banding comes from server lag (everyone, plus slow mobs) or network lag (one player, server looks normal to others). Strict anti-cheat movement checks can cause it too.
- Blocks reappearing happens when the server is behind or the packet arrives late, but also when a protection or claims plugin denies the break. Rule that out first.
- Missing or frozen chunks can be any of the three. Ask whether it happens only in new terrain (server generating chunks) or everywhere (client or connection).
The order to check in
- Ask who's affected. One player points to the client or network. Everyone points to the server.
- Have the player check FPS when the lag hits. Low FPS means their computer.
- Check TPS and MSPT. MSPT over 50 or TPS under 20 means the server, and a profiler will show why.
- If FPS is fine and the server is healthy, look at that player's ping and connection.
The rest of this guide is about step 3.
TPS and MSPT: what each one measures
A Minecraft server runs the world in ticks. In each tick it moves mobs, runs redstone, ticks hoppers and furnaces, grows crops, flows water, processes player actions and handles chunk loading. The target is 20 ticks per second, which gives each tick a budget of 50 milliseconds (1000 ms divided by 20).
- TPS (ticks per second) is how many ticks the server actually completed per second, usually shown as averages over 1, 5 and 15 minutes. In normal play it can't go above 20, because a server that finishes a tick early just waits for the next one. (The
/tickcommand added in 1.20.3 can set a higher rate or sprint, but that's not normal play.) - MSPT (milliseconds per tick) is how long a tick took. Under 50 ms the server has spare time. Over 50 ms it can't fit 20 ticks into a second and TPS starts to drop.
Why MSPT is the more useful number
TPS is capped at 20, so a server running 10 ms ticks and one running 48 ms ticks both show a perfect 20. The first has lots of headroom. The second is one busy farm away from lagging. MSPT shows that gap before players feel it.
TPS is also an average, and averages hide spikes. A server that runs 15 ms ticks but takes 250 ms on one tick every ten seconds still reads about 19.9 TPS. Players feel that quarter-second freeze every ten seconds anyway. A steady 40 ms server feels better than one that averages 25 ms but spikes to 200 ms.
So look at the spread of MSPT, not one number:
| MSPT figure | What it tells you |
|---|---|
| Median | A normal tick. Well under 50 ms means everyday load is fine. |
| 95th percentile | Your bad ticks. One in twenty ticks is at least this slow. Over 50 here means players feel hitches about once a second. |
| Max | The single worst tick. One huge max with everything else low is usually a one-off: a chunk generation burst, a garbage collection pause, a plugin task. |
A high median means something costs time every tick (entities, hoppers, too many ticking chunks). A low median with a high 95th percentile means something happens now and then (chunk generation, a periodic plugin task, a redstone contraption firing, GC pauses).
Rough TPS guide
Brief dips during startup, saves or exploration are normal. Sustained TPS below about 18 is something players notice, and below 15 the world runs at three quarters speed or worse. MSPT in the 40s with 20 TPS means no headroom left.
How to check
- Paper and Spigot:
/tpsshows the 1, 5 and 15 minute averages. Paper also has/msptfor recent tick times. Plain CraftBukkit has neither. - Vanilla 1.20.3 and newer:
/tick queryshows the target rate and average tick time. - spark (bundled with Paper, and available as a plugin or mod for Spigot, Fabric, Forge and NeoForge):
/spark tpsshows TPS over several windows plus MSPT as min, median, 95th percentile and max.

In that example the 15 minute average still reads 19.67, which looks fine on its own. The last 10 seconds tell the real story: a median tick of 74 ms means every tick is over budget, so this is steady load rather than an occasional spike.
Profiling with spark
TPS and MSPT tell you that ticks are slow. A profiler tells you why. On Paper 1.21 and newer, spark is built in (Timings was removed in 1.21.3). On other platforms, install the spark plugin or mod.
Taking a useful profile
/spark profiler start --timeout 300
That records for five minutes and then uploads the results and gives you a link to a web viewer. You can also run /spark profiler start and stop it yourself with /spark profiler stop.
Two rules matter more than anything else:
- Profile while the lag is happening. A profile taken in the morning with two players online, when the complaints were about twenty players in the evening, will look clean. It's not wrong. It's a picture of a server that wasn't lagging.
- Profile long enough. spark works by sampling: every few milliseconds it records what each thread is doing. Short profiles are noisy and can miss a spike that happens once a minute. A few minutes under real load is a good default.
For spiky lag, where the median is fine but the 95th percentile is bad, use:
/spark profiler start --only-ticks-over 100
This only records ticks longer than 100 ms (pick a number above your normal MSPT), so the call tree shows only what was happening during the slow ticks.
Reading the report
A spark report has health numbers at the top (TPS, MSPT, memory, garbage collection) and a call tree below.
- TPS and MSPT. Steady lag (high median) or spikes (high 95th percentile or max)?
- Memory and garbage collection. A few short collections are normal. Frequent, long pauses freeze the server while they run, and show up as high max MSPT while the call tree looks calm. That points to too little memory or poor startup flags, not game content. Heap use that climbs and never comes back down after collections can mean a leak;
/spark heapsummaryshows which object types are piling up. - Open the main thread, usually called
Server thread. Lag in the tick loop happens there. Other threads handle networking and chunk I/O. Hide sleeping time, because on a healthy server a lot of the main thread is just waiting for the next tick, which is spare capacity, not lag. - Follow the heaviest branch. At each level, expand the line with the biggest percentage. Keep going until it splits into several small branches or you reach something recognisable: a plugin's package name, entity ticking, block entity ticking or chunk work. Newer spark versions can also group time by plugin or mod, which is a quick first look.
- Compare with a normal profile. A plugin using a quarter of the tick might look alarming until you see it uses the same share on a good day.
Exact method names differ between Minecraft versions and between Paper, Fabric and Forge, but the shape is the same.
What each cause looks like in the call tree
- Plugin lag: the tree goes from the tick into the event system or the scheduler, then into classes from one plugin's package (something like
com.author.pluginname). Every plugin costs something. Look for one plugin taking a big slice, or one doing file reads, database queries or web requests on the main thread. On Fabric and Forge, mod code is often mixed into the game's own methods, so look for mod package names deeper inside entity or block entity ticking. - Entity lag: the entity ticking branch under the world tick is the biggest. Deeper down you'll often see which kind: mob AI and pathfinding, villagers, item entities.
- Block entity lag: a separate branch under the world tick, often named something like
tickBlockEntities, with hopper code and container lookups underneath. - Chunk generation and loading: branches about loading, generating and sending chunks, usually large in profiles taken while players were exploring.
The call tree tells you what costs time, not where it is in the world. To find the build, use /paper entity list on Paper, which shows entity counts by type and the chunks holding the most of them. Then go and look.
Reading latest.log: the warnings that matter
Everything in the console is also written to logs/latest.log. On restart, the old log is compressed with the date in its name and a new one starts. Each line has a level: INFO is routine, WARN means the server noticed something unusual, ERROR usually comes with a stack trace and means code failed. Count before you panic: a warning that shows up 3 times a day and one that shows up 3,000 times are different problems.
"Can't keep up! Is the server overloaded?"
[14:02:11] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 2154ms or 43 ticks behind
The server logs this once it has fallen about 2 seconds (40 ticks) behind schedule, then skips the missed ticks instead of trying to catch up. That's why the two numbers always match: 2154 ms divided by 50 ms is about 43 ticks. The warning is rate-limited, so it doesn't print every tick.
It's usually harmless when:
- It appears once during startup, while worlds and plugins load.
- It follows a player flying fast into new terrain.
- The number is huge, like
Running 61000ms or 1220 ticks behind. That almost always means the host machine slept, the VM was paused or the system clock jumped, not that the game lagged. - It shows up once every few hours with no complaints.
It's a real problem when it repeats steadily during normal play, when the ms value climbs without anyone exploring, or when players are reporting slow mobs and reappearing blocks at the same time. The warning never says why ticks are slow. That's what spark is for.
"moved too quickly!" and "moved wrongly!"
Steve moved too quickly! 12.4,0.0,3.1 means the server rejected a movement packet because it went much further than the player should be able to move in one update, and teleported them back. The numbers are the x, y and z distance. Vanilla's limit is about 10 blocks beyond expected movement, with more allowance for elytra. Spigot and Paper expose it as moved-too-quickly-multiplier in spigot.yml (default 10.0).
Lots of these from many players at once point to server lag: slow ticks make movement packets arrive in bursts. If they appear right after a "Can't keep up", treat it as one problem. Constant lines from one player walking on flat ground while TPS is fine point to their connection or client mods. A few from players on elytra or riptide tridents are normal.
moved wrongly! means the server's own simulation of a move ended up more than moved-wrongly-threshold (0.0625 blocks by default) away from where the client said. The player is only pulled back if they'd end up inside a block, and slabs, stairs, pistons and boats on ice trigger it constantly. Ignore it unless players get stuck in one spot.
"The server has stopped responding!"
This comes from the watchdog in Spigot and Paper, a separate thread that watches the main thread. If one tick runs for too long, it prints a thread dump. Spigot's timeout-time in spigot.yml defaults to 60 seconds, after which the server shuts down. Paper prints earlier warnings before that.
This is never noise: the whole server froze for every player. Read the stack for Server thread in the dump. A plugin package name there means that plugin was running when the server froze. A stack sitting in world saving or chunk loading points to slow storage or a very large world.
Plugin errors
Could not pass event ... to ... and Plugin ... generated an exception while executing task mean a plugin's code failed while handling an event or a scheduled task, and the plugin is named in the line. Once is a bug to report. Hundreds per minute slow the server down, because every stack trace costs time to build and write.
Read warnings in context: check what happened just before (a player joining, a world save, a plugin task). A burst of "moved too quickly" a few seconds after "Can't keep up" is one problem, not two.
The usual causes of server lag
Profiles on survival servers point to the same handful of things again and again. They're covered here roughly in order of how often they show up.
Entities: mob farms, items and villager halls
Every mob, dropped item, arrow, minecart, armor stand and item frame is an entity, and entities in ticking chunks cost tick time whether anyone is looking at them or not. A player is one entity. A mob farm can put hundreds into the same few chunks.
- Mob AI. Every mob runs goals each tick: look for targets, path, avoid hazards, wander. Small per mob, large across a few hundred.
- Crowding. Mobs push each other, and the server checks collisions between each mob and its neighbours. A packed breeder pen costs more than the same animals spread across a field. The
maxEntityCramminggamerule (24 by default) kills mobs past that count in one space, but pens get expensive long before that. - Villagers are among the most expensive mobs. Their brains keep scanning for beds, job sites and bells, pathing to them, tracking gossip and checking for threats. Locking one in a 1x1 cell doesn't switch any of that off, and a trading hall runs dozens of copies in the same few chunks.
- Item entities each have physics, check for nearby items to merge with and check for hoppers or players to pick them up. They last 6000 ticks (five minutes) by default. A farm whose output chest is full can leave thousands of them on the floor within minutes.
- Minecarts collide with each other and with mobs. A stack of hopper or chest minecarts in one spot is a classic collision cost.
Often one build is most of the problem: a single broken collection system with a full chest can cost more than every other farm combined.
Mob caps: why hostile mobs disappear on busy servers
Mobs fall into spawn categories (monsters, creatures, ambient, water animals, water ambient, underground water creatures, axolotls). Each category has a cap. When the count reaches it, natural spawning for that category stops. Spawners, spawn eggs and commands ignore it.
In vanilla and Spigot the cap is shared. Each base value applies to a 17 by 17 chunk area (289 chunks) and scales with the number of loaded chunks around players, but all mobs count toward one pool. One player AFK at a farm full of live mobs, plus another mining in huge unlit caves, can fill the monster cap between them. A third player waiting on the surface for night gets no spawns at all.
Paper's per-player-mob-spawns (under entities.spawning in paper-world-defaults.yml, on by default) gives each player their own cap and counts mobs against the players near them. The total stays about the same, but one player can no longer use up everyone else's spawns. Purpur inherits this. Plain Spigot doesn't have it.
The numbers themselves live in bukkit.yml:
spawn-limits:
monsters: 70
animals: 10
water-animals: 5
water-ambient: 20
water-underground-creature: 5
axolotls: 5
ambient: 15
ticks-per:
animal-spawns: 400
monster-spawns: 1
water-spawns: 1
water-ambient-spawns: 1
water-underground-creature-spawns: 1
axolotl-spawns: 1
ambient-spawns: 1
Those are the defaults. spawn-limits sets how many mobs of each category can be alive. ticks-per sets how often the server tries to spawn more, in ticks. If the cap is full, a faster ticks-per does nothing, because every attempt is skipped. Lowering a cap is the most direct way to have fewer mobs, and it also slows every farm that relies on natural spawning, so announce it rather than changing it quietly. spigot.yml's mob-spawn-range (in chunks, default 8) controls how far from players mobs can spawn; a smaller range keeps them near players rather than in distant caves.
The Bukkit.yml Generator shows spawn limits and spawn rates side by side with the rest of the file.
Block entities and hoppers
A block entity (older name: tile entity) is a block that stores more data than a block state can hold: chests, barrels, shulker boxes, hoppers, droppers, furnaces, brewing stands, beacons, spawners, signs, banners, campfires. Some of them tick every game tick for as long as their chunk is ticking: furnaces burn fuel, spawners count down, hoppers move items. Non-ticking ones like full chests cost time when their chunk loads and saves rather than every tick.
Hoppers are usually the real cost in a storage room, not the chests. Each tick, a vanilla hopper counts down its cooldown, tries to push an item into the container it faces, and tries to pull one from the container above or from item entities on top. If it moved something, it waits 8 ticks (hence 2.5 items per second). If it moved nothing, it tries again next tick.
That last case is the expensive part. An idle hopper doesn't rest. It searches for items and checks container slots every tick. Multiply that by every hopper in a sorting system or chest wall and the server is doing a lot of work to move nothing. Hoppers under a farm's collection area are doubly expensive because they also interact with all the item entities above them.
Redstone clocks, pistons and lag machines
A redstone clock runs every tick its chunk is ticking, whether anyone is near it or not. What makes redstone expensive:
- Dust. When redstone dust changes power level it updates its neighbours, and vanilla's dust code does a lot of redundant updates. A long line switching on and off many times a second adds up.
- Fast clocks don't add a new kind of cost. They repeat the same cost many times per second. A clock that fires every few seconds is rarely a problem. One that fires every couple of ticks and drives pistons is.
- Pistons turn the moved block into a temporary moving-block entity, cause block updates at the start and end, may trigger light updates, and send packets to every nearby player. A piston can push up to 12 blocks, so big slime block machines and flying machines move a lot per cycle. They also cost client FPS for players nearby.
- Observer chains cascade: an observer firing is itself a state change, so observers facing each other form one of the fastest clocks in the game.
- Comparators reading containers update whenever the contents change.
A lag machine is a build designed to slow or crash a server by stacking these as hard as possible, often hidden in a chunk that stays loaded. Most servers treat building one as griefing. The harder case is a legitimate farm that costs as much as a small lag machine, which is a conversation with its owner, not a ban.
On versions before 1.21.9, spawn chunks stay loaded and keep redstone there running even with nobody nearby (the spawnChunkRadius gamerule, default 2 since 1.20.5, controls their size). From 1.21.9 the area around world spawn loads and unloads like the rest of the world. /forceload chunks still keep redstone and block entities running everywhere, so check for them when a lag source seems to have no player near it.
Random ticks and randomTickSpeed
Crops, saplings, leaf decay, grass spread, farmland drying out, ice melting near light and copper weathering all run on random ticks.
Every game tick, the server splits each simulated chunk into 16 by 16 by 16 sections and picks randomTickSpeed random blocks in each section (default 3). A section has 4,096 blocks, so at the default any one block is picked on average once every 1,365 ticks, about 68 seconds. Sections with nothing that can react, such as all air or all stone, are skipped. On 1.21.11 and newer the gamerule is named random_tick_speed.
There are two parts to the cost. Picking a position is cheap. Reacting is the expensive part: when a crop grows a stage, the server changes the block state, updates neighbours and sends the change to nearby players. That cost scales with how many reacting blocks are inside ticking chunks and how high the rate is. At 30, every section gets 600 picks a second instead of 60.
Things to know before touching it:
- Raising it speeds up everything, not just crops. Leaves vanish, grass covers paths, ice melts and copper roofs weather much sooner than builders expect. On Spigot and Paper,
spigot.ymlhas per-plant growth modifiers (wheat-modifier,cane-modifier,cactus-modifierand others) that speed up one crop without touching anything else. - Setting it to 0 turns random ticks off completely. That's common on creative and build servers to freeze leaves, grass, ice and copper, but it stops crops and saplings growing everywhere, so it breaks survival farming. It's not a way to pause one farm.
- Vanilla only random-ticks chunks with a player within 128 blocks horizontally. A huge farm in the wilderness costs almost nothing most of the day. Several large farms in the same busy area, like next to spawn or a shopping district, react together whenever anyone is near. Observer-based sugar cane, bamboo, melon and pumpkin farms add redstone on top: every growth fires an observer and pistons.
On most survival servers, entities, hoppers and chunk generation cost more than random ticks. Check spark before cutting the rate and slowing growth for everyone.
Chunks, view distance and simulation distance
A chunk is a 16 by 16 column from Y -64 to Y 320 in the overworld (1.18+). Since 1.18, server.properties has two separate settings, both defaulting to 10:
view-distanceis how many chunks around each player are loaded and sent to the client. It mainly costs memory, disk reads and bandwidth. Since 1.20.2 the server sends a roughly circular area, about 350 chunks at 10.simulation-distanceis how far around each player chunks actually tick: mob AI and spawning, block entities, redstone, fluids, random ticks. It mainly costs CPU and tick time. Chunks inside view distance but outside simulation distance are visible but frozen.
Both scale with the square of the distance, because the area is roughly (2r + 1) by (2r + 1) chunks:
| Distance | Chunks per player (square) |
|---|---|
| 4 | 81 |
| 6 | 169 |
| 8 | 289 |
| 10 | 441 |
| 12 | 625 |
Going from simulation distance 4 to 8 is 3.6 times as many ticking chunks per player, not twice as many. Raising view distance from 8 to 12 more than doubles the chunks each player holds.
How players spread out matters as much as how many there are. Two players standing together share most of their chunks, and each chunk is only loaded and ticked once. Ten players at ten separate bases each bring their own set. A 20-player server where everyone hangs around spawn behaves nothing like one where everyone goes off in different directions.
A short rule: if TPS is fine but RAM is full, look at view distance. If RAM is fine but MSPT climbs under load, look at simulation distance and what's inside it.
Chunk generation
Generating a chunk that has never existed is one of the heaviest things a server does: structures, biomes, 3D noise terrain, caves, ores, trees and lighting. Because trees, lakes and structures cross chunk borders, one new chunk also means partial work on the chunks around it.
Walking into new land is usually manageable. A player on an elytra with fireworks pulls in a new row of chunks along the edge of their view distance faster than many servers can generate them. TPS drops for everyone, chunks pop in late and the profile fills up with chunk branches. Paper and C2ME move a lot of this off the main thread, but the CPU still has to do the work, and the main thread still waits on chunks players need right now.
Loading a chunk that already exists on disk is far cheaper. That gap is why pregeneration works (covered below).
Plugins and mods
Every plugin costs something. The ones that hurt are those doing slow work on the main thread (database calls, file scans, web requests), those throwing errors hundreds of times a minute, and heavy features running constantly: map renderers like Dynmap and BlueMap during full renders, large WorldEdit operations (FastAsyncWorldEdit handles big edits better), and aggressive anti-cheat checks. spark's per-plugin view tells you which ones are actually expensive on your server. If lag started right after installing something, remove it, profile again and compare.
Memory and garbage collection
Too little memory makes the Java garbage collector run constantly, which shows up as regular spikes in max MSPT with a calm call tree. More memory doesn't raise TPS beyond that point, though. Tick time is CPU-bound, and a heap far larger than the server needs doesn't help. Set -Xms and -Xmx to the same value and use tuned G1 flags such as Aikar's. Check your Java version first: Minecraft 1.20.5 through 1.21.x needs Java 21, and 26.1 and newer need Java 25.
java -Xms6G -Xmx6G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M \
-XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem \
-XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs \
-Daikars.new.flags=true -jar server.jar nogui
Aikar's guide suggests slightly different G1 values above 12 GB. The JVM Arguments Generator builds these flags for a given amount of RAM, and the RAM Calculator estimates how much a server of your size needs.
Fixes that work
Apply these based on what the profile showed, not all at once. Changing one thing at a time and profiling again tells you what actually helped.
Lower view and simulation distance
# server.properties
view-distance=8
simulation-distance=6
Simulation distance is the one that moves MSPT. A small SMP on modest hardware often runs well at view distance 8 and simulation distance 4 to 6. Public servers with dozens of players commonly drop view distance to 6 or 7 and simulation distance to 3 or 4. Because of the 128-block rule, simulation distances below 8 also shrink the area where crops grow and mobs spawn naturally around each player, while farms players stand next to keep working.
Spigot and Paper allow per-world overrides in spigot.yml, so lobbies and the Nether can run lower than the main world:
world-settings:
default:
view-distance: default # uses server.properties
simulation-distance: default
world_nether:
view-distance: 6
simulation-distance: 4
The View Distance Calculator suggests a starting pair of values from your memory, player count and target TPS. Then check /tps and /mspt with players actually online and spread out, not on an empty server.
Pregenerate the world and set a border
Pregenerating means generating every chunk in an area before anyone plays there, so exploring inside it only ever loads chunks from disk. The usual tool is Chunky, available as a plugin for Paper and Spigot and as a mod for Fabric, Forge and NeoForge:
/worldborder set 10000
/chunky world world
/chunky radius 5000
/chunky start
/chunky progress
/worldborder set takes a diameter, while Chunky's radius is measured from the center. A border of 10000 matches a radius of 5000. If they don't match, players either hit the border early or walk past the edge into fresh chunks. ChunkyBorder can enforce a border that matches what you generated. Use /chunky pause and /chunky continue to stop during busy hours and resume later. Run it before launch or overnight, because the server works hard while it runs.
What it costs:
- Disk. Chunk count grows with the square of the radius. A 5000-block radius square is 390,625 chunks. A 10000 radius is 1,562,500. Actual size depends on terrain, version and mods, so check the world folder partway through rather than trusting a quoted figure. Backups grow with it, and the Nether and End count too if you generate them.
- Time. Hours for large radii, longer with worldgen mods. Chunky shows an estimate as it runs. On Fabric, C2ME spreads generation across more cores.
- Locked-in terrain. Existing chunks keep the terrain they were generated with. New biomes and structures from an update, such as the pale garden from 1.21.4, only appear in newly generated chunks. Pregenerating a huge radius on day one means players have to travel past it to find new content after updates. Starting smaller and expanding the border later leaves room. MCA Selector can delete chunks players barely visited (using each chunk's InhabitedTime) so they regenerate on the new version; take a backup first.
Pregeneration fixes exploration lag. It doesn't reduce how many chunks are loaded or ticking, so it doesn't replace sensible view and simulation distances.
Switch to Paper or Purpur
Moving from Vanilla or Spigot to Paper usually lowers MSPT on its own, and it unlocks the config options below. Purpur is a Paper fork with extra options. Switching keeps your world and plugins: back up, stop the server, swap the jar and start it again.
Paper does fix some vanilla exploits by default, such as TNT duplication, headless pistons and bedrock breaking. Technical players who rely on them can turn them back on in the unsupported-settings section of paper-global.yml, at their own risk. Most Spigot plugins run on Paper unchanged, but Paper is now a hard fork, so test plugins that depend on Spigot internals. For a fuller comparison of server software, see Paper vs Spigot vs Fabric vs Forge.
Tune entity settings in spigot.yml
world-settings:
default:
mob-spawn-range: 6 # default 8
entity-activation-range:
animals: 16 # default 32
monsters: 24 # default 32
raiders: 48 # default 64
misc: 12 # default 16
water: 12 # default 16
villagers: 16 # default 32
flying-monsters: 32 # default 32
tick-inactive-villagers: true
merge-radius:
item: 3.5
exp: 4.0
nerf-spawner-mobs: false
entity-activation-rangeis the most effective entity setting. Entities outside the range only tick occasionally instead of every tick. The trade-off: farms that rely on mobs moving or falling far from the player can slow down or stop, which is why some farm designs that work in singleplayer underperform on Spigot and Paper. Lower in small steps and check farms players care about.tick-inactive-villagers: falsestops villagers outside the activation range from ticking. It saves a lot on servers with big trading halls but can affect breeding and job site behaviour when nobody is near.entity-tracking-rangecontrols how far away entities are sent to players. Lowering it cuts network traffic and client load near big farms, but does little for server tick time, because entities still tick when nobody can see them.merge-radiuscombines nearby dropped items and XP orbs into fewer entities. Larger values mean fewer entities, and drops visibly jump toward each other.nerf-spawner-mobs: trueremoves AI from spawner mobs. It makes spawner-based farms cheap, but mobs no longer move on their own, which breaks farms that rely on mobs walking into water streams.max-entity-collisions(default 8) caps how many collisions an entity processes per tick, which helps crowded pens and minecart piles.
The Spigot.yml Generator lays out activation and tracking ranges, item merging and hopper settings with an explanation of each.
Tune Paper's world config
These go in config/paper-world-defaults.yml (or a per-world paper-world.yml override):
entities:
spawning:
per-player-mob-spawns: true
alt-item-despawn-rate:
enabled: true
items:
cobblestone: 300 # 15 seconds instead of 5 minutes
netherrack: 300
dirt: 300
gravel: 300
chunks:
max-auto-save-chunks-per-tick: 24
entity-per-chunk-save-limit:
arrow: 16
experience_orb: 16
snowball: 16
hopper:
cooldown-when-full: true
disable-move-event: false
ignore-occluding-blocks: false
tick-rates:
sensor:
villager:
secondarypoisensor: 80 # default 40
behavior:
villager:
validatenearbypoi: 60 # default -1 (vanilla rate)
misc:
redstone-implementation: VANILLA
alt-item-despawn-rateclears junk drops like cobblestone quickly while leaving everything else at the normal five minutes. Players lose fewer valuables after a death than they would with a global despawn change.entity-per-chunk-save-limitstops a chunk slowly filling with arrows or XP orbs over weeks and lagging every time it loads. The default is no limit.- Despawn ranges (
entities.spawning.despawn-ranges) set soft and hard despawn distances per mob category. Tighter ranges clear mobs no player is near, freeing space in the cap sooner. max-auto-save-chunks-per-tickspreads auto-saves across ticks. If the server hitches on a regular five-minute rhythm, auto-save is the likely cause, and lowering this number smooths it out.- Villager
tick-ratesmake some villager brain tasks run less often, which helps big trading halls.
The Paper Config Generator builds paper-global.yml and paper-world-defaults.yml with these sections.
Reduce hopper cost
Hopper settings exist in both files. Paper reads spigot.yml too, so both apply on Paper.
| Setting | File | Default | Effect | Risk |
|---|---|---|---|---|
cooldown-when-full | Paper | true | A hopper that can't push into a full container waits instead of retrying every tick | Very low, already default |
ticks-per.hopper-check | spigot.yml | 1 | How often an idle hopper checks again | Low at small values; idle hoppers react slightly later |
ticks-per.hopper-transfer | spigot.yml | 8 | Cooldown after moving an item | Slows hoppers; breaks hopper clocks and timed redstone |
hopper-amount | spigot.yml | 1 | Items moved per transfer | Breaks comparator item sorters that expect one item at a time |
disable-move-event | Paper | false | Stops InventoryMoveItemEvent firing on transfers | Lock, protection and shop plugins that use the event stop working, so players may drain locked chests |
ignore-occluding-blocks | Paper | false | Hoppers ignore containers inside solid blocks | Breaks some farm and storage designs |
The safe path is to keep cooldown-when-full on and raise hopper-check slightly. Raising hopper-transfer together with hopper-amount keeps throughput similar with fewer transfers, but it changes item timing in ways technical players will notice. Announce it first.
Building habits help as much as config: use water streams or minecart unloaders for bulk collection instead of long hopper lines, keep hopper chains short, and make sure farm output chests have room. A full chest under a farm is the most common source of item pileups.
Limit redstone without banning it
max-chained-neighbor-updatesinserver.properties(since 1.19, default 1000000) caps chained neighbour updates. It's a crash safety net against runaway update chains, not a general lag fix.redstone-implementationin Paper'smiscsection has three values:VANILLA(default),EIGENCRAFTandALTERNATE_CURRENT. Both alternatives cut redundant dust updates a lot. They only change dust, not pistons, observers or hoppers, and they change the order of some updates, so builds that depend on exact vanilla behaviour can break. Test players' big builds on a copy of the world first. Technical SMPs often stay onVANILLAand handle performance with rules instead.- Plugins fill the gaps: anti-clock plugins remove redstone that toggles faster than a set limit, and chunk limit plugins such as Insights cap hoppers, pistons or observers per chunk. Both are blunt and can't tell a lag machine from a fast but legitimate farm.
Rules that work on most SMPs: every clock needs an off switch and farms get turned off at logout, big piston builds and flying machines need staff approval, staff can switch off any build that's hurting TPS and will tell the owner why, and lag machines are a ban. When one build shows up in a profile, show its owner the numbers. A slower clock, an off switch or a smaller breeder usually fixes it without anyone losing a build, and announcing global changes like lower mob caps saves players an evening debugging a farm that got slower on purpose.
Clean up entities, carefully
For a one-off cleanup:
/kill @e[type=item]
/kill @e[type=experience_orb]
/kill @e[type=arrow]
Since 1.21.2 each boat and raft has its own entity type (oak_boat, spruce_boat, bamboo_raft and so on), so type=boat no longer matches anything. Don't run broad /kill commands on minecarts or mobs without checking first: they remove storage minecarts, farm animals and named pets just as easily as junk.
Scheduled clear-everything plugins like ClearLagg are largely unmaintained and break farms and drops without warning. Paper's alt-item-despawn-rate, per-chunk save limits, merge radius and despawn ranges deal with the same problem more precisely. For persistent problem areas, /paper entity list finds the chunk, and CoreProtect's /co inspect shows who built what.
Performance mods for Fabric servers
Paper builds its optimizations into the server software. Fabric stays close to vanilla, and you add performance through server-side mods. None of these add content, so players can join with a plain vanilla client.
| Mod | What it changes | Changes gameplay? |
|---|---|---|
| Lithium | Game logic: entity movement and collisions, mob AI, block ticking, hoppers, villager POI lookups | Aims to match vanilla exactly; individual optimizations can be disabled in config/lithium.properties |
| FerriteCore | Memory use, mainly by storing block states more compactly | No |
| C2ME | Spreads chunk generation, loading and saving across more CPU cores | No for redstone and spawning; may clash with heavy worldgen mods |
| Krypton | Networking code | No |
| Alternate Current | Replaces redstone dust logic | Yes, changes update order |
| ServerCore | Lowers view distance, mob caps and similar settings when the server is under load | Yes, farms produce less while it's active |
| spark | Profiling only | No |
A sensible starting set for most Fabric SMPs is Lithium and FerriteCore. Add C2ME if players explore a lot or you pregenerate large worlds, and the server has cores for it to use; on a server with only a couple of cores it won't do much. FerriteCore's savings grow with the number of blocks in the game, so it matters more on heavily modded servers, and it's also available for Forge and NeoForge. Ask technical players before adding Alternate Current or ServerCore, because they change behaviour on purpose.
Add mods one at a time on a copy of the world, test the farms players actually use, and profile before moving each one to the live server. Plan Minecraft updates around when these mods support the new version, not just when Fabric does.
Server lag checklist
- Confirm it's server lag: everyone affected, MSPT over 50 or TPS under 20.
- Read median, 95th percentile and max MSPT in
/spark tpsto tell steady lag from spikes. - Count "Can't keep up", watchdog dumps and repeating plugin errors in
latest.log. - Take a spark profile during the lag and follow the heaviest branch on the main thread.
- Find the build with
/paper entity listand fix it with its owner. - Lower simulation distance first, then view distance if memory is short.
- Pregenerate inside a world border that matches the Chunky radius.
- Run Paper or Purpur, or Lithium, FerriteCore and C2ME on Fabric.
- Tune activation ranges, mob caps, despawn rates and hoppers one change at a time, profiling after each.
- Check GC pauses, set
-Xmsequal to-Xmxand use tuned G1 flags on the right Java version.
If everything in this list is done and MSPT is still high with a normal player load, the server likely needs more CPU than it has. Tick time depends mostly on single-thread speed, so compare plans on that rather than on RAM or core count. If you'd rather not manage the server side yourself, ChunkPod is a Minecraft host in early access, and you can join the waitlist at chunkpod.com.
Related guides: