What lag looks like in a spark profile
We ran a real test server, caused one kind of lag at a time, and recorded a spark profile of each. This is what came back.
The results
| What we did | Typical tick | TPS | Top cause in the profile |
|---|---|---|---|
| Nothing, idle flat world | 0.8 ms | 19.9 | Nothing. Server thread idle 97% of the time |
| 3,000 cows in forced chunks | 40.9 ms | 19.2 | Mobs pushing and colliding, 49% |
| 500 villagers | 13.3 ms | 20.0 | Villagers, 88% |
| 6,000 dropped items | 10.1 ms | 20.0 | Dropped items, 80% |
| About 9,200 hoppers between chests | 2.2 ms | 20.0 | Hoppers, 54% |
| Observer clocks across 225 by 225 blocks | 1.2 ms | 16.4 | Redstone, 99% |
| 30 repeating command blocks using @e | 129.9 ms | 10.0 | Commands and datapack functions, 97% |
| Force-loading new land from the console | 3.2 ms | 17.3 | Waiting for a chunk to be ready, 70% |
| Test plugin burning 70 ms of CPU each tick | 70.8 ms | 14.0 | LagMaker, 97% |
| Test plugin sleeping 80 ms each tick | 84.6 ms | 12.3 | LagMaker, 98% |
| Test plugin allocating 100 MB each tick, 768 MB heap | 10.9 ms | 19.9 | LagMaker, 85%. Collector statistics: Pauses took about 5% of the server's time. |
Paper 26.3 on a shared laptop (Intel i7-11370H, other work running), no players connected, 60 second profiles with spark's Java sampler. These numbers show the shape of each problem. They are not a benchmark, and your server will differ.
What this shows
- Mobs in numbers are expensive, and much of the cost is mobs colliding rather than thinking.
- A plugin that blocks shows up by name, and waiting looks different from computing. A server thread that sleeps has spare CPU and is still lagging.
- Garbage collection does not appear in the stacks. It only shows in the collector statistics, which is why reading the tree alone can miss it.
Wrong guesses to avoid
- "It's Lithium." Optimization mods patch hot game code, so their names appear in the stacks of whatever is busy. That doesn't make them the cause.
- "The crash guard mod is using 30%." Mods that wrap the entity tick look huge in a tree view, because every entity runs inside them. This tool passes through wrappers and counts what ran inside.
- "More RAM will fix it." Only if collection pauses or a full heap show up in the numbers.
Try it on yours
Paste your spark link into the explainer and it reads the profile for you.