Profiling with Spark
Find the lag source with a Spark report.
Spark is a profiling tool that helps find the cause of server lag — whether from a plugin, entities, or specific world operations. Spark is available as a plugin (Java) and is often bundled in modern Paper/Purpur servers.
Note
Spark only **diagnoses**, it does not fix. Use its results to decide which plugin/setting is burdening the server.
Basic Commands#
Run in the Console or chat:
| Command | Purpose |
|---|---|
/spark tps | Show server TPS and CPU usage. |
/spark profiler start | Start recording performance. |
/spark profiler stop | Stop and produce a report (link). |
/spark health | Server health summary. |
/spark ping | Measure ping/latency. |
How to Profile#
- Run
/spark profiler startwhile the server is lagging (ideally when many players are online). - Let it run for 30–60 seconds.
- Run
/spark profiler stop. - Spark gives a report link — open it to see which plugins/operations consume the most time.
Reading the Results#
- Look at the largest section in the chart: that is the main load source.
- If a plugin dominates, consider removing, updating, or replacing it.
- If entities/chunks dominate, limit mob spawns and optimize world settings.
Tip
Access heatmaps can be analyzed with `/spark profiler start --only-ticks-over 100` to record only slow ticks.
See also the Lag Optimization guide for further steps.
Install Spark#
If it is missing, upload spark.jar to the plugins folder, then Restart the server. Check with /spark — if a help message appears, Spark is active.
