What the analyzer checks
spark records what the server was doing many times per second, and uploads it together with the server’s numbers and config files. The analyzer reads all of it and goes through four things:
- How the server is doing. TPS and MSPT over the last minutes, CPU, memory, players and loaded entities, and a bar per minute so you can see when it got slow.
- Java and the machine. The heap size, the garbage collector and whether it uses Aikar’s flags, full garbage collections, memory left after collecting, CPU threads, and whether the machine is short of memory or busy with other things.
- Settings. view-distance and simulation-distance in server.properties, spawn limits in bukkit.yml, entity activation ranges in spigot.yml, and Paper’s and Purpur’s options for explosions, redstone, collisions, spawners, hoppers, armor stands and villagers. Each finding says which file and key to change.
- Plugins. The time each plugin takes on the main thread, plugins that tend to cause trouble (ClearLag, PlugMan, mob stackers), and the chunk with the most entities, with a /tp command to go there.
Findings are sorted from what to fix first to optional tips. While the server keeps up, setting changes show as tips: they free time you don’t need yet.
How to make a spark profile
- Run
/spark profiler startin the console or in game. On Paper and Purpur 1.21 and newer, spark is already built in. - Let it record for at least 5 minutes at a normal time, with players online. A profile of an empty server only shows an idle server.
- Run
/spark profiler stop. spark uploads the profile and prints ahttps://spark.lucko.me/…link. - Paste the link above. The analysis starts on its own.
For lag that comes in spikes rather than all the time, record only the slow ticks: /spark profiler start --only-ticks-over 100 keeps ticks that took over 100 ms and ignores the rest.
TPS and MSPT
The server runs the world in ticks, 20 per second, so each tick has 50 ms. MSPT (milliseconds per tick) is how long a tick really took. While it stays under 50, the server holds 20 TPS and has time to spare. Once ticks take longer, TPS drops, and mobs, redstone and crops slow down for everyone.
| MSPT | What it means |
|---|---|
| Under 30 ms | Plenty of room for busy moments |
| 30 – 45 ms | Fine, but with little margin |
| 45 – 50 ms | At the limit: any spike shows |
| Over 50 ms | The server falls behind and TPS drops |
The analyzer looks at the 95th percentile, the time 95 % of ticks stayed under. An average hides slow ticks; the 95th percentile doesn’t.
Reading the time per plugin
The plugin list adds up the time spent inside each plugin’s code on the main thread and divides it by the ticks recorded, so it reads in ms per tick, against the 50 ms each tick has. A plugin taking 5 ms per tick uses a tenth of the budget on its own. Time a plugin spends calling another plugin counts for the one it calls, the way spark’s own viewer counts it.
What’s left after the plugins is the game itself: entities, chunks, redstone and players. The settings findings are aimed at that part. To see exactly which task of a plugin takes the time, open the profile in spark’s viewer and switch to the Sources view.
The changes that usually help most
- Lower simulation-distance to 5 or 6, and view-distance to around 8. Simulation distance decides how much of the world ticks around each player, so it weighs on every tick.
- Lower entity activation ranges in spigot.yml, so mobs far from players tick less often.
- Use Paper’s options: optimize-explosions, the ALTERNATE_CURRENT redstone implementation, max-entity-collisions of 2 and a spawner tick rate of 2.
- Start Java with Aikar’s flags and a heap that fits the server. The RAM calculator writes both for you.
- Pre-generate the world with a plugin such as Chunky, so new chunks aren’t generated while people play.
Change one thing at a time and record a new profile afterwards. That way you know what helped, and what to undo if a farm stops working.
Your profile and privacy
The analyzer runs in your browser: the profile is downloaded straight from spark.lucko.me and never goes through EndyStudio. Keep in mind that a spark profile includes your server’s config files (spark hides passwords, IPs and similar keys), and that anyone with the link can open it.