How to Read a spark Profiler Report and Find What's Lagging
"The server is laggy" isn't something you can fix directly. You need to know what is eating the tick time: a mob farm, a plugin, new chunks being generated, or something else. spark is the tool that tells you, and reading its report is easier than it looks once you know where to click.
/spark profiler start, wait 2 to 5 minutes, then run /spark profiler stop and open the link. In the viewer, expand Server thread and keep following the biggest percentages down. Whatever takes the largest share of the tick is your problem. For short spikes instead of constant lag, use --only-ticks-over 100.First, check if there's really a server problem
Not every kind of "lag" is the server. Rubber-banding and delayed block breaking with a high ping is network lag. Low FPS is the player's computer. The server is only the problem if TPS drops or MSPT is high.
Run:
/spark tps
You'll see TPS (ticks per second) and MSPT (milliseconds per tick) over the last few time windows.
- TPS 20 and MSPT under 50: the server is keeping up. Look at network or client causes.
- TPS under 20 or MSPT over 50: the server can't finish its work in time. Profile it.
A tick has 50 milliseconds. If the average tick takes 70 ms, the server can only manage about 14 ticks per second, and everything slows down. More background on that in why is my server lagging.
For a quick overview of memory, CPU and disk too, run:
/spark health
Run the profiler
Start it while the lag is actually happening. Profiling a quiet server at 4 AM tells you nothing.
/spark profiler start
Let it run for 2 to 5 minutes while players do whatever they normally do. Then:
/spark profiler stop
spark uploads the result and gives you a link in chat. Click it to open the viewer in your browser.
If you'd rather not remember to stop it, give it a timeout in seconds:
/spark profiler start --timeout 180
For lag spikes, not constant lag
If the server is fine most of the time and freezes every few minutes, a normal profile averages the spikes away. Tell spark to only record the slow ticks:
/spark profiler start --only-ticks-over 100
This only keeps ticks that took longer than 100 ms, so the report shows what was happening during the freezes. Leave it running long enough to catch several spikes.
Reading the viewer
The report opens as a tree. At the top level you'll see threads. The one that matters most is Server thread. That's the main game loop where entities, blocks, redstone and most plugin code run. If Server thread is slow, the whole server is slow.
Click to expand it. Each line shows a percentage: how much of the recorded time was spent in that part of the code and everything under it. The method is simple:
- Expand Server thread.
- Find the child with the biggest percentage.
- Expand that one.
- Repeat until the percentages split into many small pieces, or you hit something you recognize, like a plugin name or a type of game activity.
Don't panic about the exact Java names. You're looking for clues, and they're usually readable: words like entity, chunk, tick, redstone, hopper, or a plugin's package name like com.sk89q.worldedit or net.coreprotect.
Use the Sources view
The viewer can also group time by plugin or mod. On a plugin server, switch to that view and you'll see a list like "PluginA 12%, PluginB 3%". If one plugin is taking a big slice, that's a strong lead. Check its config, update it, or try the server without it for a day.
What common problems look like
Too many entities. Most of the tick goes to entity ticking: mob AI, pathfinding, item entities, villagers. This is the most common cause on survival servers. Count and cull them with the steps in TPS drops from too many mobs.
Chunk generation. Big chunks of time in world generation or chunk loading, usually when players are exploring new areas or flying with elytra. Fix it by pre-generating the world and setting a world border so new terrain stops being created during play.
One plugin. A single plugin name sitting high in the tree or the Sources view. Common offenders are plugins that run heavy tasks every tick, scan inventories or write to a database on the main thread.
Hoppers and redstone. Block entity ticking taking a large share. Big item sorters and redstone clocks run every tick whether anyone is looking or not.
Garbage collection. If the profile looks spread out but players still feel stutters, check /spark gc. Long or frequent GC pauses point at memory settings, not game content. See Aikar's flags explained and how much RAM a server needs.
Nothing stands out, but MSPT is high. The server might just be doing more than the CPU can handle: lots of players spread far apart, a high view and simulation distance, or a heavy modpack. Lowering view and simulation distance is the biggest single lever.
Finding where the entities are
Once spark points at entities, you need to know where they are. Paper has a command that lists entity counts by type and chunk:
/paper entity list
Run it to see which mob types there are the most of, and in which worlds. Then go and look. It's usually a breeding pen with 600 cows or a farm nobody turned off.
Useful spark commands
| Command | What it does |
|---|---|
/spark tps |
TPS and MSPT over recent time windows |
/spark health |
TPS, MSPT, CPU, memory and disk in one view |
/spark profiler start |
Start recording |
/spark profiler stop |
Stop and upload the report |
/spark profiler start --only-ticks-over 100 |
Only record slow ticks (for spikes) |
/spark gc |
Garbage collection stats |
/spark heapsummary |
What's using memory right now |
All of these need operator permission or the matching spark permission.
Asking for help with a report
If you can't make sense of the tree, share the link with someone who can: your host's support, the plugin author, or a server admin community. Include:
- What the lag feels like (constant, every few minutes, only when someone is online)
- How many players were on during the profile
- Your server software and Minecraft version
A spark link with that context gets a much faster answer than "server laggy pls help".
Related
- Why is my Minecraft server lagging?
- Why are chunks loading slowly?
- "A single server tick took 60 seconds" fix
- Best Minecraft server plugins
FAQ
Do I need to install spark on Paper?
Recent Paper builds ship with spark built in, so try /spark first. On older Paper, Spigot, Fabric, Forge or NeoForge, download spark for your platform and add it like any other plugin or mod.
Does running the profiler slow the server down?
Very little. spark is a sampling profiler, so it takes snapshots of what the server is doing instead of timing every method. It's safe to run on a live server with players online.
Who can see my spark report?
Anyone with the link. The report contains plugin and mod names, world names and some server settings, but not passwords. Only share it with people you trust to help.
Want a server that just runs fast?
FreaksMC runs on NVMe hardware with performance-tuned defaults baked in - pre-optimized Paper, sane view distances, and one-click world pre-generation. Set up in 60 seconds.
See plans from $3/mo