How to use Spark commands¶
Spark is a performance analysis tool for Minecraft servers. Spark helps check TPS, profile CPU usage, dump the heap, and produce health reports.
Basic usage¶
Commands can be run from:
- the console, without a leading
/ - in-game, with a leading
/
Commonly used commands¶
| Command | Function |
|---|---|
/spark tps |
View the server's TPS |
/spark profiler start |
Start the profiler |
/spark profiler stop |
Stop the profiler and create a result |
/spark profiler open |
Open the latest profiler result |
/spark health --upload |
Create a health report and upload it |
/spark gc |
View the garbage collection history |
/spark heapdump |
Write a heap dump to disk |
How to find the cause of lag¶
- Run
/spark profiler start. - Let the server run while the lag happens.
- Run
/spark profiler stop. - Open the result with
/spark profiler open.
Important notes¶
- According to the official spark documentation,
/spark gcshows garbage collection history; it is not a magic button that "frees RAM" permanently. - The documented official command for a health report is
/spark health, not/spark healthreport.
Extra analysis examples¶
/spark profiler start --timeout 60for a 60-second auto-stop profiler/spark health --uploadto generate a shareable report
Help us out
If you found this tutorial useful, please leave a review on Trustpilot! Your rating helps us make more useful guides
Cheers, Team NexusCloud