How to Reduce Lag on a Minecraft Server

To reduce lag on a Minecraft server, first work out whether it's server lag (TPS below 20) or connection lag. Then tackle the usual causes in order: too many loaded chunks, piled-up entities, redstone clocks, garbage collection pauses and on-the-fly world generation. A spark profile tells you which one is really to blame.

Key takeaways

  • Measure before you change anything: stable 20 TPS means the problem is the network or the client, not the server.
  • Lowering simulation distance and pre-generating the world are the two changes with the biggest effect for the least effort.
  • Entities (mob farms, dropped items, villagers) and redstone clocks cause most server-side lag on small servers.
  • Paper bundles the spark profiler since 1.21: one report points at the exact plugin, entity or chunk dragging the tick down.
Reducing lag on a Minecraft server: TPS, entities, chunks and redstone

Server lag or connection lag? Diagnose first

"Lag" covers two different problems. Server lag means the server can't finish its work within each 50-millisecond tick, so TPS (ticks per second) drops below 20 and the whole world slows down for everyone. Connection lag means the server is fine but data reaches a player late. The fixes are completely different, so check which one you have before touching a single setting.

Type Symptoms Likely cause
Server lag (TPS)Mobs freeze, blocks reappear after breaking, everyone affectedOverloaded CPU, too many entities, redstone, chunk generation
Connection lagRubber-banding, delayed actions, only some players affectedA player's connection or Wi-Fi, distance to the server
Memory (GC) spikesShort freezes at regular intervalsToo little RAM, or Java flags that don't suit the heap

On Paper or Spigot, /tps shows the average over the last 1, 5 and 15 minutes; /spark tps adds tick durations and CPU usage. If TPS holds at 20 while one player complains, look at their connection, not the server. If it's "lagging only for me" on your own PC, the client (graphics settings, shaders, mods) is the usual suspect.

Cut loaded chunks: view distance, simulation distance and pre-generation

Every chunk the server keeps loaded costs CPU and RAM, and every brand-new chunk it has to generate costs far more. That's why chunk settings are the first place to look. Two values in server.properties matter here: view-distance (how far players can see) and simulation-distance (how far entities, crops and redstone keep running), split into two settings since 1.18.

The trick is to keep a reasonable view distance for looks while lowering the simulation distance, because simulated chunks are what eat the tick. The Paper documentation for server.properties describes both. On a small server, a simulation distance of 5 to 6 chunks is usually plenty.

If the server lags mainly when players explore, world generation is the cause. Pre-generate the playable area before launch with a plugin like Chunky: set a centre and a radius, start it, and let it run while nobody is online. Combined with a world border, players then only ever load chunks that already exist.

Rein in entities and farms

Entities are the leading cause of CPU lag on small servers. A single player can build a chicken farm or a villager trading hall that adds hundreds of entities without noticing, and each one runs AI and collision checks every tick. Dropped items and experience orbs count too.

  1. Find the hotspots. A spark report or a quick entity count by chunk shows which builds are responsible.
  2. Lower spawn limits slightly. The spawn-limits in bukkit.yml control how many mobs of each category can exist per player; trimming them a little is barely visible in play.
  3. Use activation ranges. The entity-activation-range settings in spigot.yml make distant mobs tick less often.
  4. Merge items. The merge-radius for items and experience reduces the number of loose entities on the ground.
  5. Agree house rules. A cap on animals per farm does more than any setting, and players accept it when they know why.

The spigot.yml reference lists the default values. Change one thing at a time and measure again, because aggressive values can break automatic farms that your players rely on.

Tame the redstone

Complex redstone (fast clocks, automatic factories, item sorters) can drag TPS down on its own, because redstone dust triggers a large number of block updates. Paper's world configuration includes a redstone-implementation option: the alternative implementations, such as Alternate Current, reduce the lag caused by dust by cutting unnecessary updates.

The catch: an alternative implementation can change the timing of very precise contraptions. Test it on a copy of the world first if your players build technical redstone. For a clock that runs non-stop in an empty base, the simplest fix is still to ask its owner to add an off switch.

Memory and garbage collection pauses

Short freezes at regular intervals usually come from the Java garbage collector pausing the server to free memory. The fix is twofold: give the server enough RAM, and use flags tuned for Minecraft. The Paper documentation on Aikar's flags recommends at least 6 to 10 GB however few players there are, with the minimum and maximum memory set to the same value.

On the Pterodactyl panel used at OnPowered, the Java startup command is editable from the Startup tab. More RAM isn't a cure-all though: past a certain point it brings nothing. Our guide on how much RAM a Minecraft server needs gives the realistic ranges for vanilla, Paper and modpacks.

Profile with spark, and know when it's the hardware

If lag persists after the steps above, profile instead of guessing. Since 1.21, Paper bundles the spark profiler: run a profile while the lag is actually happening, then open the link it gives you. Look for whatever takes a large share of the tick: a shop plugin hammering its database, an over-eager anti-cheat, a chunk full of entities.

If the report shows the tick spread evenly across normal game work, the server is simply too small for what you run. Modded servers in particular need more headroom; see our guide to modded Minecraft server hosting. Free hosts with capped RAM hit this wall quickly, as we explain in our look at free Minecraft hosting. At OnPowered, every plan runs on NVMe storage with DDoS protection included, and you can upgrade without downtime or data loss.

FAQ

Why does my server lag with only a few players?

Player count is rarely the issue. Check whether someone has built a large mob farm, a villager hall or a redstone clock that runs non-stop: a single player can add hundreds of entities without noticing. Unexplored terrain being generated as people travel is the other common cause on a new world.

Why is my Minecraft server lagging but my internet is fine?

If everyone sees mobs freeze or blocks reappear, the server itself is struggling and TPS has dropped below 20, whatever your connection speed. Check TPS with /tps or spark, then look at entities, loaded chunks, redstone and memory. If only one player lags, look at their connection instead.

Do Paper's optimisations break vanilla behaviour?

Some can. An alternative redstone implementation may change the timing of very precise contraptions, and lower entity limits or item merging can affect automatic farms. Change one setting at a time, test it on a copy of the world with a few players, and keep a backup before opening it up to everyone.

Which OnPowered plan fits your server?

If profiling shows the server is simply too small: Iron (16 GB) is the comfortable tier for Paper with plugins; Gold and above for modpacks.

PlanRAMvCoresStoragePriceLink
Coal8 GB320 GB NVMe€5.99 per monthOrder
Iron16 GB440 GB NVMe€11.99 per monthOrder
Gold24 GB570 GB NVMe€16.99 per monthOrder
Diamond32 GB6100 GB NVMe€22.99 per monthOrder
Emerald48 GB8120 GB NVMe€35.99 per monthOrder

Free 7-day trial on the Minecraft plans, no commitment: start the trial. Full details: Minecraft plans.

See also

If your server keeps lagging because it's out of room, a managed Minecraft server at OnPowered gives you NVMe storage, DDoS protection and a Pterodactyl panel with Paper (spark included) installed in one click. Iron (16 GB) at €11.99 per month suits most plugin servers, with a 7-day free trial to check the difference. Order the Iron plan or see all Minecraft plans.