Tools / Spark Analyzer
Your report
To make a report: run /spark profiler start on the server, wait a few minutes while the lag is happening, then run /spark profiler stop and paste the link it gives you. Health reports and heap summaries work too, and so do saved .sparkprofile files (drop one anywhere on this box).
A link is downloaded straight from spark's server into your browser; a file never leaves your device. We do not receive either. Details
Where the main thread's time went
A plugin's share is the time its code was running on the main thread, including what it asked the server to do. It is counted once, at the outermost plugin.
Slowest single methods time spent in the method itself
Minute by minute
Each bar is one minute: the dark part is a typical tick, the light part the longest tick of that minute. The line is the limit of one tick.
World
What fills the memory largest types in the heap summary
Settings that matter for lag
Memory and machine
Plugins
How to read a spark report here
- Make sure the server has spark. Recent Paper builds include it; on other servers, install the spark plugin.
- While the lag is happening, run
/spark profiler start. Wait a few minutes, then run/spark profiler stop. - Paste the link spark gives you and press Analyze. Links from
/spark healthand/spark heapsummarywork too. - No link? Run
/spark profiler stop --save-to-fileand open the.sparkprofilefile here, or drop it on the box..sparkhealthand.sparkheapfiles work the same way, up to 64 MB. - Read the findings from the top; the most serious come first. Copy summary for support gives a short text for a ticket or Discord.
What the analyzer checks
- Is the server lagging? It compares TPS over the last 1 and 5 minutes and the typical and slowest tick times with the 50 ms a tick has, and says Healthy, Close to the limit or Lagging. It also points out single long ticks.
- Where the main thread's time went. Each plugin's share of the time, next to Minecraft itself and the idle time between ticks. If one plugin takes a quarter or more of the working time on a busy or lagging server, it is named, with the code it spent the time in.
- Slowest single methods, measured by the time spent in the method itself, and a minute by minute chart of typical and longest ticks.
- The world. Entity counts by type and the busiest chunks with their coordinates. A chunk with 150 or more entities is flagged; that is usually a farm, a mob grinder or a pile of dropped items.
- Memory. A heap that stays almost full, long garbage collection pauses, different
-Xmsand-Xmxvalues, and start flags without garbage collector settings. - The machine. A full processor, other programs using most of it, swap in use and a disk that is almost full.
- Settings that matter for lag:
simulation-distance,view-distanceandmax-playersfrom server.properties,mob-spawn-rangeandentity-activation-rangefrom spigot.yml, andspawn-limitsfrom bukkit.yml. - Heap summaries: the object types that fill the memory. Plus the plugin list with versions, the Java version and the start flags.
Spark report terms, explained
TPS (ticks per second) is how often the server updates the world. 20 is full speed. MSPT (milliseconds per tick) is how long one update takes. At 20 TPS a tick has 50 ms; when the typical tick needs more, TPS drops and players feel lag.
The main thread runs the world, entities and most plugin code. Lag almost always shows up there. A CPU profile shows where its time goes. Memory (allocation) and lock profiles measure other things, and the analyzer tells you when you have one of those.
Self time is time spent inside one method, without the methods it calls. A plugin's share is counted once, at the outermost plugin, and includes the work it asked the server to do.
Questions
What is a good MSPT for a Minecraft server?
A tick has 50 ms at 20 TPS. A server whose slowest ticks stay under about 40 ms has room to spare. When the typical tick takes longer than 50 ms, TPS drops below 20 and the server lags.
How long should I run the spark profiler?
A few minutes, while the lag is actually happening. A profile of the server at a quiet moment shows nothing useful. The analyzer warns you when a profile covers less than a minute.
The analyzer names a plugin. Should I remove it?
Not straight away. Some plugins do a lot of work by design. Check the plugin's settings, update it, and send the report to its author. Removing it is the last step, not the first.
Is my spark report sent to Lethium?
No. A link is downloaded from spark's server straight into your browser, and a file is read on your device. The analysis runs in your browser.
Can it read health reports and heap summaries?
Yes. Links from /spark health and /spark heapsummary work, and so do saved .sparkprofile, .sparkhealth and .sparkheap files.