
Something is eating your TPS. You check the player count, it is only 12 players. Should be fine. But TPS sits at 15 and blocks break with a delay. The CPU graph in your panel looks calm and there is RAM to spare. Without data, you are guessing. Spark stops the guessing.
Quick answer: On Paper 1.21 or newer, spark is already installed. Run /spark tps to see TPS and MSPT, then /spark profiler start --timeout 300 while the lag is happening and open the link it prints. Follow the highest percentages under "Server thread" down to the plugin, mod or game system that uses the time. For short spikes, run /spark tickmonitor --threshold-tick 50 first and then profile only the slow ticks with --only-ticks-over.
What Spark Does
Spark is a performance profiler for Minecraft servers. It samples what the server's threads are doing, every 4 milliseconds by default, and builds a tree of where the time goes. The result is a report that shows which plugins, mods or game systems are eating your tick budget.
That budget is 50 milliseconds. The game wants 20 ticks per second, so each tick has to finish in 50 ms or less. Spark's own guide calls 50 or fewer milliseconds per tick (MSPT) "the magic number". Once ticks take longer, TPS drops below 20 and players feel it. Normal system monitoring cannot show you this, because the problem lives inside the game's tick loop, not in the operating system.
Installing Spark
On Paper 1.21 and newer you skip this step: Paper bundles spark and calls it the preferred way to profile. Timings, the old Paper profiler, is deprecated and switched off by default since 1.21, so guides that tell you to run /timings on are out of date.
Everywhere else, download spark from spark.lucko.me and put the jar in the right folder, then restart:
- Spigot or older Paper:
plugins/ - Fabric, Forge or NeoForge:
mods/ - Velocity or BungeeCord proxy: the proxy's
plugins/folder
On a proxy the command is /sparkv (Velocity) or /sparkb (BungeeCord), and in a Fabric or Forge client it is /sparkc. Everything below uses /spark.
You need the spark permission or operator status. To let staff use only part of it, spark has a permission per command, such as spark.tps, spark.health, spark.profiler, spark.tickmonitor and spark.heapdump. Keep spark.heapdump to yourself: a heap dump is a copy of everything in the server's memory.
Basic Commands
| Command | What It Does |
|---|---|
/spark tps | TPS, MSPT (min, median, 95th percentile, max) and CPU usage |
/spark health | Health report with TPS, CPU, memory and disk usage, as a live page that refreshes every 10 seconds |
/spark health upload | The same report as a fixed link you can share |
/spark profiler start | Starts recording a profile |
/spark profiler start --timeout 300 | Records for 5 minutes, then stops and uploads by itself |
/spark profiler open | Opens the viewer for a profile that is still running |
/spark profiler stop | Stops recording and prints the report URL |
/spark profiler cancel | Stops without uploading anything |
/spark tickmonitor --threshold-tick 50 | Reports every tick that takes longer than 50 ms |
/spark gc | Garbage collection history |
/spark ping | Average player ping, or one player's with --player <name> |
How to Record a Good Profile
- Wait for the lag to happen, or trigger it by having players do what normally causes it
- Run
/spark profiler start - Wait at least 3 to 5 minutes with players online doing normal things. For lag that comes and goes, give it 10 to 15 minutes
- Run
/spark profiler stop - Open the URL that appears in chat or in the console
A 30 second profile is usually too short. You need enough samples for patterns to show up. Profiling an empty server tells you nothing at all.
Catching Short Lag Spikes
A normal profile averages everything. One tick of 400 ms between thousands of normal ticks gets lost in that average. Spark's own lag spike guide works in two steps.
First, find out how bad the spikes are:
/spark tickmonitor --threshold-tick 50
This prints a line for every tick that takes longer than 50 ms, the point where the server starts falling behind. If chat fills up too fast, raise the number. If players feel spikes but nothing shows up, lower it.
Then profile only the slow ticks, with a threshold below the spike but above a normal tick. If the spikes hit 250 ms:
/spark profiler start --only-ticks-over 100 --timeout 120
The report now leaves out all the healthy ticks, so the thing causing the spike stands out.
Reading the Spark Report
The report opens in your browser on spark.lucko.me.
The Profiler Tree
The viewer first shows the threads it profiled. On a Minecraft server, "Server thread" is the one that matters: it runs the game. Click it to expand its children, and keep expanding. Each line shows a share of the thread's time, and hovering shows the milliseconds.
The trick is to follow the numbers. Keep opening the child with the highest percentage until you reach something you recognise. Time spent sleeping is healthy, it means the server finished a tick early and is waiting for the next one. Two other views help: the flat view lists the slowest 250 method calls at the top level, and the flame graph (the Flame icon in the top bar) draws the same tree as bars, where wider means more time.
What to look for:
- Plugin or mod names: if a plugin's or mod's classes sit under a wide branch, that plugin or mod is responsible for the load
- Minecraft classes: names like
LivingEntity,ServerChunkCacheorHopperBlockEntitytell you which game system is the bottleneck
Do not blame the first plugin name you see. A plugin can show up because the game called it while doing the real work, so look for the deepest call that repeats.
Common Findings
Entity classes such as LivingEntity and Mob, or pathfinding (PathNavigation), taking 30% or more of the tick:
Too many mobs. Lower the spawn limits in bukkit.yml or the activation ranges in spigot.yml, and check mob farms and villager halls.
HopperBlockEntity (for example pushItemsTick or tryMoveItems) taking 15% or more:
Hopper networks are too large. Paper's hopper.disable-move-event helps a lot but breaks plugins that rely on that event, such as chest protection. Our Paper settings guide covers the hopper options and what they cost.
Chunk loading or generation, for example ServerChunkCache.getChunkFutureMainThread, taking 20% or more:
Players are exploring new terrain faster than the server can generate it. Pregenerate the world with Chunky or lower the view distance.
A specific plugin taking 10% or more: That plugin is a performance problem. Check its configuration, update it, or find an alternative.
Garbage collection pauses in /spark gc or the health report:
See the memory section below.
Step-by-Step Example
You profile your server and the Spark report shows:
100% Server thread
├── 35% Chunk ticking
│ ├── 20% Entity ticking
│ │ └── 15% Monster pathfinding
│ └── 12% Hopper transfers
├── 25% Plugin: a shop plugin
│ └── 22% Database query
├── 15% Chunk loading
└── 25% Everything else
Reading this:
- Monster pathfinding uses 15%: Too many monsters. Lower
spawn-limits.monstersin bukkit.yml (the default is 70) or themonstersactivation range in spigot.yml (default 32 blocks) - Hopper transfers use 12%: Find the big sorting systems first.
ticks-per.hopper-transferin spigot.yml is already 8 by default, and raising it makes every hopper slower than vanilla, so tell your players before you touch it - The shop plugin uses 25%: It runs database queries on the main thread every tick. Check its config for a cache or update interval, update it, or report it to the developer with the profile link
- Chunk loading uses 15%: Players exploring new terrain. Pregenerate with Chunky
After making these changes, profile again. Compare the new report with the old one. You should see those percentages drop. Change one thing at a time, or you will not know which change helped.
Memory and Garbage Collection
Garbage collection lag looks different from CPU lag. The server freezes for a moment every few minutes and then recovers, and memory use climbs steadily before dropping sharply at each freeze.
/spark gc
/spark health
/spark gc shows how often the collector ran and how long it took. /spark gcmonitor toggles a message for each collection, so you can line them up with the freezes players report.
The usual fixes:
- Give Java a heap that fits your plan. PaperMC advises staying about 1000 to 1500 MB below the memory you have, and setting
-Xmsequal to-Xmx - Use Aikar's flags, or test ZGC with our ZGC vs G1GC guide
- If memory keeps climbing after every collection, look for a leak
For that last case, /spark heapsummary uploads a summary of which object types fill the heap, without creating a huge file. /spark heapdump writes a full .hprof snapshot to disk, which you can open in VisualVM or Eclipse MAT. Do not share heap dumps publicly.
Sharing Spark Reports
Profiles and health reports get a unique URL on spark.lucko.me. Spark's docs say you can freely share that link, so send it to:
- Plugin and mod developers (to show them their code is slow)
- Hosting support (to diagnose hardware issues)
- Community forums (to get optimization help)
Developers take performance reports with profiler data seriously, because it is direct evidence of the problem.
When to Profile
- After adding a new plugin or mod
- When TPS drops below 18 during normal play
- After a Minecraft version update
- Before and after optimization changes (to measure improvement)
- Whenever players report lag and you cannot identify the source
On a modpack such as ATM10 or Cobblemon, profile while players do the thing that hurts: exploring, opening big storage systems, running farms or loading a town. Then see our ATM10 lag fix or Cobblemon optimization guides.
Make profiling a regular habit. Profile once a month during peak hours even if nothing seems wrong. You might catch a slow leak before it becomes a crisis.
On a Space-Node Minecraft server you type these commands in the panel console, no SSH needed. Paper servers have spark built in, and for Fabric, Forge or NeoForge you upload the spark jar to mods/ with the file manager. Get started here.