Direct answer
Do not start by adding RAM or copying an “optimization config.” First confirm the server is actually tick-bound, then profile it while the lag is happening.
- On Paper 1.21+, run
/spark profiler start --timeout 600during the problem. - Reproduce normal player activity for the profile window.
- Open the spark result and identify the largest branches under the tick thread/region that is slow.
- Fix the specific cause: entities, chunk generation, a plugin/mod task, redstone/block updates, hoppers/inventories, saving, or another measured workload.
- Run a second profile under similar conditions and compare.
What MSPT means
MSPT means milliseconds per tick. A normal Minecraft server targets 20 ticks per second, so it has about 50 ms to finish each tick. If the server consistently needs more than 50 ms, it cannot maintain 20 TPS.
Short spikes above 50 ms can happen during world saves, chunk generation, garbage collection, or bursts of entity/block work. A sustained average is more important than one isolated maximum.
Use spark, not guesswork
Paper 1.21 and newer bundles spark and Paper documents it as the preferred profiler. Paper's older Timings profiler is deprecated and disabled by default in modern Paper.
/spark profiler start --timeout 600The issue must happen during the capture. A profile from an empty server at 3 AM cannot explain a lag spike that only occurs with 40 players online.
Common causes of high MSPT
- Entities: large farms, villagers, pathfinding mobs, item entities, minecarts, armor stands, or plugin-created entities.
- Chunks: players exploring new terrain, heavy world generation, chunk loading/saving, or storage that cannot keep up.
- Plugins/mods: expensive synchronous listeners, scheduled tasks, database/file work on a tick thread, or modded block/entity logic.
- Redstone and block updates: clocks, large contraptions, fluids, pistons, explosions, or update-heavy farms.
- Inventory systems: large hopper networks and plugins that react to item movement.
- GC or memory pressure: frequent/long garbage collections or swapping can create pauses.
What to fix first
Fix the largest measured cost first. If spark shows entity AI dominating, changing JVM flags is unlikely to solve the main problem. If the profile is mostly chunk generation, reducing mob caps will not address it.
Paper vs Folia
Most Paper workloads still depend heavily on the main server tick thread, even though chunk I/O, networking, GC, and plugins can use additional threads. Folia is different: it groups nearby chunks into independent regions and ticks those regions in parallel. Do not apply Paper single-thread assumptions blindly to Folia profiles.
References
These sources were checked while preparing this article. Performance behavior and configuration can change between Minecraft/server-software versions, so verify version-specific settings before applying them.
- PaperMC: Profiling
- PaperMC: Commands — performance profiling
- spark: performance profiler for Minecraft
- PaperMC Folia project
Related articles
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.