How to Use spark on a Minecraft Server (2026 Guide)
Published
Short answer: install spark (Paper 1.21+ already has it), run /spark tps and /spark health to see whether the problem is the tick or the memory, then /spark profiler start --timeout 300 while the lag is happening. Open the link it posts, switch to the Sources view, and the mod or plugin using the most tick time is at the top.
This guide covers the commands that matter, the flags worth knowing, and how to read the result without being a Java developer. Commands are from spark's own command docs; versions are from spark's Modrinth page as of November 2026.
Step 1: get spark on the server
| Server type | What to do |
|---|---|
| Paper 1.21 and newer | Nothing. Paper bundles spark (Paper docs). |
| Paper 1.20.x and older, Spigot | Put the spark plugin jar in plugins/ and restart. |
| Fabric, Forge, NeoForge | Put the spark mod jar for your loader and Minecraft version in mods/ and restart. Players don't need it. |
Pick the build that matches your Minecraft version exactly. The newest builds (1.10.187, September 2026) are for 26.x. For 1.21.1, the most common modded version, the newest builds are 1.10.124 for NeoForge and 1.10.109 for Fabric and Forge. Some packs already include it: All the Mods 10 ships spark 1.10.124, so check your mods folder before adding a second copy.
On Paper, if you want a newer spark than the bundled one, drop the plugin in plugins/ and start the server with -Dpaper.preferSparkPlugin=true.
Run commands as an operator in game, or from the server console without the slash. On a Packyard server that's the console in the panel.
Step 2: the 30-second check
/spark tps
/spark health
/spark gc
/spark tpsprints ticks per second over several recent windows, tick durations (MSPT) and CPU use. A healthy server shows 20 TPS and a tick time under 50 ms. 50 ms is the budget for one tick, so a median of 45 ms means you're about to lag even if TPS still reads 20./spark healthopens a live dashboard of TPS, MSPT, CPU, memory and disk. If you'd rather have it in chat or the console, use/spark health show --memory./spark gclists garbage collection runs and how long they took.
How to read the three together:
| What you see | What it means | Where to go next |
|---|---|---|
| TPS under 20, MSPT over 50 ms, memory fine | The main thread can't keep up (CPU, worldgen, machines, mobs) | Step 3, the profiler |
| Memory near the limit, frequent or long GC | The heap is too small, or something is leaking | Our out-of-memory crash guide |
| TPS 20, MSPT low, players still lag | Network or the player's own PC | /spark ping, and the player's client |
| TPS fine most of the time, short freezes | Spikes: one heavy tick now and then | Step 3 with --only-ticks-over |
Most of the time it's the first row. Minecraft runs the world on one main thread, so a server can have gigabytes of free RAM and still lag.
Step 3: run the profiler
The profiler samples what the server is doing every few milliseconds and uploads a report you open in the browser.
/spark profiler start --timeout 300
That records for 5 minutes and then posts a link. Run it while the lag is happening: get players online, or go and do the thing that lags (fly into new chunks, turn on the factory, walk into the mob farm). A profile of an empty, idle server tells you nothing.
The other ways to run it:
/spark profiler startthen/spark profiler stop: record for as long as you like./spark profiler open: get the link without stopping./spark profiler info: is it running?/spark profiler cancel: throw it away without uploading.
Flags worth knowing:
--only-ticks-over 100records only ticks that took longer than 100 ms. Use it for spikes and stutters; without it, the bad ticks get averaged in with the good ones.- **
--thread *** records every thread, not just the main one. Useful when the lag is chunk loading or networking, which run on other threads. --allocprofiles memory allocation instead of CPU time, to find what's creating the garbage behind constant GC.- On stop,
--comment "5 players, after restart"labels the report, and--save-to-filekeeps it on disk instead of uploading it.
The uploaded report includes your mod or plugin list and system details, and anyone with the link can open it. Share it with the people helping you, not in a public channel you don't trust.
Step 4: read the report
Open the link. The spark viewer lists threads first; click Server thread, which is the main game thread.
Use the Sources view first. Click the eye icon in the top bar and pick Sources. It splits the time by mod or plugin, so the top entry is the one costing the most. That's usually enough to know where to look.
Then use the All view (the default tree) to see what inside the game is slow. Click a line to expand it and keep following the biggest percentage down. Each line shows a share of the thread's time, and hovering shows the milliseconds. Ignore time spent sleeping or "parked": that's the server waiting for the next tick, which is healthy.
What the usual suspects look like in the tree:
- Chunk generation: lots of time in the chunk system and world generator classes (
ServerChunkCache,ChunkMap,NoiseBasedChunkGeneratorand the worldgen mods' own packages). Fix: pre-generate the world before people explore. - Block entities (machines, hoppers, storage): time under block entity ticking (
LevelChunk$BoundTickingBlockEntity) leading into tech mods' packages. Fix: find the build, limit chunk loaders. - Entities (mobs, items, farms): time under entity ticking (
ServerLevel.tickNonPassenger). Fix: clear item piles, cap farms. - One plugin or mod at the top of Sources with a task you don't expect: update it, check its config, or remove it and profile again.
The Flat view lists the slowest 250 methods. Set it to Self Time to see the exact methods that burn the most time on their own.
If the method names look scrambled (class_3218, m_8793_), pick the right mappings from the dropdown in the top right; the viewer usually detects them on its own.
Spikes, memory and the rest of spark
/spark tickmonitortoggles a monitor that reports in chat whenever a tick runs long. Add--threshold-tick 100to report every tick over 100 ms. Leave it on during the laggy hour and you'll see if spikes line up with a GC run or an event./spark gcmonitorposts each garbage collection as it happens./spark heapsummaryuploads a summary of what's using memory, by class. A mod's package near the top points at a leak./spark heapdumpwrites a full.hproffile to disk instead (it's about the size of the heap, so check disk space first)./spark pingshows average player ping;/spark ping --player Nameshows one player.
Fix guides that start from a spark report
The same spark-first approach, with the fixes worked out for specific packs:
- Cobblemon server lag: worldgen and the Pokémon spawner, with the config keys we tuned on a test server.
- ATM10 server lag: NeoForge's block entity tracker, pre-gen and chunk loader limits for All the Mods 10.
- RLCraft server lag: 1.12.2, where spark builds are older and the options are fewer.
If spark says memory really is the limit, the RAM calculator suggests a size by pack and player count.
Run your server on Packyard
Packyard charges $1.50 per GB of RAM per month (USD plus applicable taxes), from $5 for 3 GB. Paper servers on 1.21 or newer come with spark built in, and on modded servers you can add it through the panel's file manager or SFTP. You get a permanent address, daily backups plus backups you make yourself, and sub-users for friends who help you run it. The order page shows which sizes are in stock right now. Available in the US and Canada (not Quebec).
Start a Paper server from $5/month, or see Minecraft server hosting on Packyard.
spark is made by lucko and contributors. Packyard is not affiliated with spark, PaperMC, Mojang or Microsoft.
FAQ
Is spark already installed on my server?
On Paper 1.21 and newer, yes: it's bundled. On Fabric, Forge and NeoForge, only if your modpack includes it. Type /spark and see if the command exists.
How long should I run the spark profiler?
3 to 10 minutes while the lag is happening. /spark profiler start --timeout 300 stops by itself after 5 minutes and posts the link.
How do I find which mod is causing lag?
Open the profiler link, select Server thread, and switch to the Sources view. It splits the tick time by mod or plugin, with the most expensive at the top.
What is a good TPS and MSPT?
20 TPS is the maximum and what you want. MSPT (milliseconds per tick) should stay under 50; above that, the server can't keep 20 TPS.
Does spark cause lag itself?
Hardly. It samples the server every few milliseconds rather than timing every call, which is why Paper replaced its old Timings profiler with it.
Do players need spark installed?
No. The server copy is all you need. There's a separate client version (/sparkc) for checking a player's own FPS.
More guides and posts on the Packyard blog.