Spark is a profiler: it watches what the server spends its time on and shows it as a tree.
Take a profile
- Install spark via the Plugins (or Mods) tab; restart.
- Wait for the lag to happen. In the console:
spark profiler start --timeout 60. It records for 60 seconds. - The console prints a link (
spark.lucko.me/...). Open it.
Read it
- Top of the page: TPS, MSPT and memory over the recording. Confirms that it lags.
- The tree below: expand
Server thread→Tick. Every line is a thing the server does per tick with a percentage. Look at the biggest percentages.EntityTickList/entityTickhigh → too many mobs or a mob-heavy area./spark tickmonitorshows where.ChunkMap/chunk generation→ players exploring. Pre-generate.- A plugin's package name (
com.example.myplugin) → that plugin. Update, reconfigure or remove it. Redstone/hopper→ a machine somewhere. Paper's hopper settings help.GCat the top or longOld Genpauses in the memory graph → not enough RAM.
Shortcut
Paste the link into Kowalski: "read this spark report and tell me what causes the lag". It reads the tree and explains it in plain words, usually with the exact config change.