Fix Minecraft server lag
TPS dropping, blocks breaking late, mobs frozen? Follow the order we use on live Paper servers: measure first, fix GC second, then world load, then entities.
1. Measure before you touch anything
Random config changes make things worse. First find out what is actually slow:
/tps— Paper shows ticks per second. Below ~15 consistently = real lag./spark profiler startthen/spark heap summary— tells you whether CPU ticks or memory/GC is the bottleneck./debug report— a snapshot of entity counts per type.
If the spark profiler shows Cleaner or GC threads high, continue to step 2. If it shows ChunkLoader or entity tick, jump to steps 3–4.
2. JVM flags: the Aikar set done right
The G1GC flag set from Aikar remains the standard for Paper-family servers. The two most common mistakes: applying it under 2 GB RAM, and forgetting -Xms=-Xmx on big heaps.
java -Xms4G -Xmx4G \
-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 \
-jar server.jar --nogui
3. View distance vs simulation distance
Minecraft separates these now, and they cost very different amounts:
| Setting | What it does | Cost | Sane default |
|---|---|---|---|
view-distance | How far chunks render for players | Bandwidth + some CPU | 8 |
simulation-distance | How far blocks/mobs/redstone actually tick | Heavy CPU + RAM | 4 |
Owners routinely leave simulation at 10 because "it looks nice". It is the single biggest hidden lag source. Drop it to 4 and almost nobody notices.
4. Entities, mobs and armor stands
- Cap mob spawns per world in
paper-world-defaults.yml(monster max, animal max). - Item frames and armor stands never despawn and each costs tick time — limit them with a clear-frames plugin on public areas.
- On Purpur, enable
entity.sleep-inactiveso distant mobs stop fully ticking. - Hopper chains: 100 hoppers ticking items every 8 ticks is a classic silent killer. Add hopper culling.
5. Pre-generate the world
Generating new chunks while players explore is the most expensive thing a server does. Run a pre-generator (Chunky) overnight for a 2–3k radius border. Players crossing into pre-generated land see no lag spike; without it, exploration = stutter.
6. When one server is not enough
If you run survival + creative + minigames on one jar, split them behind a proxy (Velocity). Each child server gets its own heap and tick loop; a redstone explosion in creative no longer freezes survival. This is exactly how networks scale — and where our SkyWars and Survival Games setups slot in as separate game servers.
Lag has a name. Find it with Spark, kill it with the right lever, and only then raise the difficulty back up.
Want it fast from day one?
Every Unique Team setup ships performance-tuned: sane simulation distance, capped spawns and an optimized launch script included.
Browse tuned setups