Minecraft server help centre

Performance

Find the cause of Minecraft server lag with spark

Lag has many causes, and guessing wastes evenings. spark records what the server thread does many times a second and groups it into a tree, so you see the real cost of every plugin, mod and game system.

This guide covers the spark commands one by one, how long to profile and how to read the report. What to do about the usual causes is in reduce lag.

In short

spark is a profiler that is built into Paper and Purpur and available as a plugin or mod for other servers. Type /spark tps to see whether the server is behind, then run /spark profiler start --timeout 120 while the lag is there. After two minutes spark posts a link to a report that shows which plugin, mod, entity type or chunk task took the most time per tick.

How to get spark on your Minecraft server

Server typeHow you get spark
Paper and Purpur, 1.21 and newerBuilt in, nothing to install
Older Paper, SpigotInstall the spark plugin
Fabric, Forge, NeoForgeInstall the spark mod on the server only
Velocity proxyInstall the spark plugin on the proxy

Players do not need spark in their own game. On Fabric and Forge it is a server side mod; see install mods for uploading it. On Paper the built-in copy steps aside when you install the spark plugin yourself.

Run the commands from the Console tab without the slash, or in the game with a slash as an operator. Other staff need the spark permission, which you can give with LuckPerms.

/spark tps: is the server really lagging?

spark tps

The output has three parts:

LineWhat it showsHealthy
TPS from last 5s, 10s, 1m, 5m, 15mTicks per second over five windows20 in all of them
Tick durations (ms) for 10s and 1mMinimum, median, 95th percentile and maximum time per tickMedian well under 50, 95th percentile under 50
CPU usageUse of the processor by the server process and the whole systemNo fixed limit; compare with a quiet moment

A tick has 50 milliseconds. When the median is under 50 but the maximum shoots to several hundred, the server has spikes: short freezes, often from a save, a big explosion or garbage collection. When the median itself is above 50, the server is behind all the time.

If TPS is 20 and players still feel lag, the cause is on their side: ping or low frames. A profiler run on the server will not find it.

/spark health: memory, CPU and disk in one view

spark health
spark health --memory

spark health adds memory use, disk space and garbage collection to the TPS lines. With --memory it also lists the memory pools of Java.

  • Memory near the maximum, all the time: the server is short of memory. Long garbage collection pauses follow.
  • Memory going up and down in a saw tooth: normal. Java fills memory and cleans it up.
  • Many old generation collections in `spark gc`: memory pressure. See how much RAM a Minecraft server needs.

Run the spark profiler with a timeout

  1. Wait until the lag is there. A profile from a quiet moment shows nothing useful.
  2. Type spark profiler start --timeout 120 in the Console. spark records for 120 seconds.
  3. Keep playing as normal. Ask players to do what they did when the lag started.
  4. After the timeout spark stops by itself and prints a link to the report.
  5. Open the link in your browser.

Without --timeout, stop the run yourself with spark profiler stop. spark profiler cancel throws a run away without a report.

OptionWhat it does
--timeout 120Stops the run after 120 seconds and uploads the report
--thread *Records every thread, not only the main server thread
--only-ticks-over 100Records only ticks that took longer than 100 ms, for rare spikes

For lag that comes and goes, use --only-ticks-over with a value above 50 and let it run longer, such as 10 minutes. The report then shows only the slow ticks, so the normal ticks do not hide the problem.

How to read a spark profiler report

The report is a tree. The top node is the server thread, and every branch below it shows a share of the time. Expand the biggest branch step by step until you reach a name you recognise.

What the branch is aboutWhat it usually means
Ticking chunksRandom ticks, crops and mob spawning in loaded chunks
Ticking entitiesMobs, items, villagers, minecarts
Ticking block entitiesHoppers, furnaces, spawners and other block entities
Chunk loading, generation or savingPlayers exploring, or saves of a large world
A package with a plugin or mod nameThat plugin or mod; most report it under its own name
Garbage collection or a sleeping threadMemory pressure, or a tick that finished early and waited

Switch to the Sources view at the top of the report to group the time by plugin or mod. That view answers the question "which plugin is it?" in one look.

Percentages are a share of the recorded time, not of one tick. A plugin at 30% of a server that runs at 60 ms per tick costs about 18 ms per tick, more than a third of the 50 ms budget.

/spark heapsummary: what fills the memory

spark heapsummary

This posts a report that lists every kind of object in memory, with the count and the size. It pauses the server for a moment while it counts, so run it once, not in a loop.

  • Many entity or item objects: a farm or item pile in a loaded chunk.
  • Many chunk objects: a high view distance or players spread over the map.
  • A class with a plugin or mod name that keeps growing between two summaries: a likely memory leak in that plugin or mod.

Compare two summaries, one shortly after a restart and one hours later. What grew is what to look at.

Other spark commands for lag

CommandWhat it does
spark tickmonitorPrints a line in the console for every tick that takes much longer than usual
spark gcShows how often garbage collection ran and how long it took
spark profiler infoShows whether a profiler run is going and for how long
spark profiler openUploads the current run without stopping it

On Paper, paper entity list counts entities per type and world, which pairs well with a profile that points at entities.

What to do with the spark result

spark points atFirst step
EntitiesFind the farm with paper entity list and thin it out
Chunk tickingLower the simulation distance in the Settings tab
Chunk generationPre-generate the world
Hoppers and block entitiesAsk players to rebuild long hopper chains
One pluginCheck its settings or replace it with a lighter plugin
Garbage collectionLook at the memory graph on the Overview tab

When a report points at something you cannot place, send the link to support with the time the lag happened. We answer every day from 07:00 to 23:00 Central European Time.

Questions from Minecraft server owners

Is spark already installed on Paper?

Yes, Paper and Purpur for Minecraft 1.21 and newer include spark. On older versions, Spigot, Fabric and Forge you add it as a plugin or mod.

How long should I run the spark profiler?

Two to five minutes while the lag is happening. For spikes that come and go, run it longer with --only-ticks-over 100.

What does MSPT mean in spark?

Milliseconds per tick. The server has 50 ms for each tick to keep 20 TPS. A median above 50 means the server is behind.

Does spark lag the server itself?

Hardly. The profiler takes samples, which costs little. Only spark heapsummary and spark heapdump pause the server for a moment.

Can players see the spark report?

Anyone with the link can open it. Share it with your staff or our support, not in a public channel.

Do players need spark installed?

No. spark runs on the server only, also on Fabric and Forge.

Checked against spark on Paper and Fabric for Minecraft Java 26.2, October 2026. Written by the Cheapest Minecraft Hosting team, first published , updated .