Stutters, delays when breaking blocks, mobs that "teleport" around – almost always the cause is low TPS. The good news: most performance problems on a Minecraft server can be greatly reduced with the right server software, proper JVM flags and a few config values. This guide walks you through finding and fixing the causes step by step.
What is TPS – and why is my server lagging?
TPS stands for Ticks per Second. A Minecraft server calculates the world 20 times per second – so the target is 20 TPS. If the value drops below that, the world runs slower than real time: the server "hangs".
Just as important is MSPT (Milliseconds per Tick) – how long the server takes for one tick. At 20 TPS you have 50 ms per tick. Values consistently above 50 ms mean lag.
| Value | Meaning |
|---|---|
| 20 TPS / < 40 ms MSPT | Everything optimal |
| 18–20 TPS | Light load, usually fine |
| < 18 TPS | Noticeable lag – find the cause |
| < 10 TPS | Server struggling, act urgently |
/tps and /mspt (available on Paper and its forks). That's always the first step when troubleshooting lag.Step 1: Choose the right server software
The biggest performance jump often comes simply from switching server software. Vanilla and Spigot are significantly slower than modern forks:
| Software | Recommendation |
|---|---|
| Vanilla | Purists only – barely optimized |
| Spigot | Better than Vanilla, but dated |
| Paper | Recommended standard – fast & compatible |
| Purpur / Pufferfish | Paper forks with even more tuning options |
For most servers, Paper is the best choice: high plugin compatibility and noticeably better performance than Spigot.
Step 2: Java version & memory
Modern Minecraft versions require an up-to-date Java version:
- Minecraft 1.17–1.20.4 → Java 17
- Minecraft 1.20.5–1.21.x → Java 21
- Minecraft 26.1 and newer (current year.drop versioning) → Java 25
For RAM the rule is: as much as needed, not as much as possible. Over-allocating memory lengthens garbage collection pauses and can actually cause more lag.
-Xms and -Xmx to the same value (e.g. both 4 GB). That way the JVM doesn't constantly grow/shrink the heap, which avoids stutters.A rough RAM guideline (without large modpacks):
| Players | Recommended RAM |
|---|---|
| 1–5 | 2–3 GB |
| 5–15 | 4–6 GB |
| 15–40 | 6–10 GB |
| Modpacks | 8 GB and up |
Step 3: Aikar's Flags – the optimal JVM startup parameters
The default JVM settings aren't ideal for Minecraft. Aikar's Flags are a proven set of startup parameters that tune the garbage collector (G1GC) to minimize lag spikes. Add them as your server's startup parameters (example for 4 GB):
java -Xms4G -Xmx4G --add-modules=jdk.incubator.vector -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
Adjust -Xms and -Xmx to your RAM. From 12 GB upwards, also change these values:
-XX:G1NewSizePercent=40
-XX:G1MaxNewSizePercent=50
-XX:G1HeapRegionSize=16M
-XX:G1ReservePercent=15
-XX:InitiatingHeapOccupancyPercent=20
Step 4: Find the causes of poor TPS
Don't guess – measure. The spark plugin shows you exactly what's slowing the server down:
- Install
sparkas a plugin - Run
/spark profiler startand let it run for a few minutes - Run
/spark profiler stop– you get a link with a detailed breakdown
This immediately shows whether entities, a specific plugin or world generation is causing the load.
Step 5: Common lag causes & fixes
| Cause | Fix |
|---|---|
| Too many entities (mob farms, items) | Lower mob limits, check item despawn |
| View/simulation distance too high | Reduce in server.properties |
| Redstone & hopper machines | Limit the count, use hopper alternatives |
| Too many or bad plugins | Remove unused ones, check with spark |
| Chunks generated on the fly | Pre-generate the world with Chunky |
| Too little/too much RAM | Match allocation to player count |
Step 6: Fine-tune server.properties & Paper config
Two values in server.properties have the biggest effect:
view-distance=8
simulation-distance=6
- view-distance = how far players can see.
10is default;8saves a lot of load with barely any visible difference. - simulation-distance = how far away the world actively "ticks" (mobs, growth).
6is a good compromise.
In the Paper configuration (config/paper-world-defaults.yml), a lower mob-spawn-range and adjusted entity activation range also help – verify the values against spark.
Quick checklist
- Use Paper (instead of Vanilla/Spigot)
- Pick the correct Java version (17, 21 or 25, depending on your Minecraft version)
-Xms=-Xmx, match RAM to player count- Set Aikar's Flags as startup parameters
- Measure with
/tpsand spark instead of guessing - Lower view-distance and simulation-distance
- Pre-generate the world with Chunky
With these steps you'll get the most out of your server. If your current machine is permanently at its limit, the only remaining fix is more power – then it's worth looking at a more powerful game server.
Frequently asked questions
How do I check the TPS on my Minecraft server?
On Paper and its forks, the /tps and /mspt commands show the current performance right in the game. For a proper root-cause analysis, run the spark plugin with /spark profiler start on top.
Which Java version does my Minecraft server need?
It depends on the Minecraft version: 1.17–1.20.4 run on Java 17, 1.20.5–1.21.x on Java 21, and from version 26.1 onwards Java 25 is required. A Java runtime that is too old stops the server from starting at all.
How much RAM does a Minecraft server need?
For 1–5 players, 2–3 GB is usually enough; 5–15 players want 4–6 GB, and larger servers or modpacks need more. Allocation matters more than quantity: set -Xms and -Xmx to the same value.
Does more RAM always help against lag?
No — over-allocating memory can actually make lag worse, because garbage collection pauses get longer. Size RAM to your player count and measure the real cause with spark instead of guessing.
What are Aikar's flags and are they safe?
Aikar's flags are a proven, publicly maintained set of JVM startup parameters that tune garbage collection for Minecraft and reduce lag spikes. They are the accepted standard – unlike many "miracle flags" from random forums.
Why does my server lag with only a few players online?
Load depends less on player count than on entities, redstone machines, view distance and world generation. The most common culprits are mob farms with many entities and chunks being generated live – both show up clearly in a spark report.