Guide · Performance

How to use spark to find lag

spark is the standard tool for answering "why is my server lagging". It records what the server spends its time on and shows the answer as an interactive report in your browser. Recent Paper builds include it, and it is available as a plugin or mod everywhere else.

Install or check it

On current Paper and Purpur, run spark to see if it is built in. Otherwise download spark from Modrinth or CurseForge for your platform, Paper, Fabric, NeoForge or Velocity, and install it like any plugin or mod.

Take a profile

Start the profiler while the lag is happening, not afterwards:

  • spark profiler start: begin recording
  • Wait at least a few minutes while players are online and lag is present
  • spark profiler stop: stop and get a link to the report
  • spark profiler start --only-ticks-over 100: record only slow ticks, great for spikes

Read the report

The report is a tree of where tick time went. Expand the Server thread and follow the biggest percentages downward. Large shares under a plugin's package name point at that plugin. Time in entity ticking points at mobs or items. Time in chunk loading or world generation points at exploration. Time in block entities points at hoppers, furnaces and modded machines.

The search box helps: type a plugin or mod name to see its total share.

Memory and health

spark health shows TPS, MSPT, CPU and memory. spark heapsummary shows which objects fill memory, useful for tracking leaks. Combined with the panel's memory graph, this tells you whether a bigger plan would help or whether something is wrong.

Sharing reports

The report link can be shared with a plugin author or a helper. It does not include passwords, but it does show plugin names and some world information, so share it with people you trust.

StormNodes Minecraft hosting

Run it on a StormNodes server

Skip the port forwarding and the PC that has to stay on. A StormNodes Minecraft server is online in minutes, and everything in this guide can be done from the panel.

  • Hosted in Portugal, close to players across Western Europe
  • NVMe storage, monthly billing and no setup fee
  • Paper, Purpur, Fabric and vanilla, switchable from the panel
  • Live console, file manager, SFTP, backups and schedules
  • Support in English and Portuguese

FAQ

Frequently asked questions

Does spark cause lag itself?
Very little. It samples the server rather than tracing everything, so it is safe to run on a live server.
Did spark replace Timings?
Yes, on Paper. Paper removed its Timings system and recommends spark, which is now included.
How long should I run the profiler?
Several minutes while the problem is present. For short spikes, use the only-ticks-over option so normal ticks do not drown them out.