Operations & Support
PerformanceTroubleshootingProfiling
4 min read

Diagnosing Lag with the Spark Performance Profiler


Diagnosing Lag with the Spark Performance Profiler

When your Minecraft server drops below 20 TPS (Ticks Per Second) or players report rubberbanding, guessing which plugin or farm is responsible is inefficient. Spark is a modern performance profiler that pinpoints the root cause down to the specific line of code or game tick event.


Installing Spark

  1. Download spark from spark.lucko.me (available for Paper, Purpur, Fabric, and Forge).
  2. Upload the jar into /plugins/ (or /mods/ for Fabric/Forge).
  3. Restart your server.

Running a Performance Profile

1. Start the Sampler

When lag is occurring, run the command in your console or in-game:
spark sampler
Spark will record tick activity and CPU allocation in the background with near-zero overhead.

2. Allow 3 to 5 Minutes of Data Collection

Let the profiler run while normal gameplay and lag symptoms are taking place.

3. Stop the Sampler and Generate the Web Report

Run:
spark sampler --stop
The console will return a link: https://spark.lucko.me/<unique-id>

How to Read the Spark Web Report

  1. TPS Graph & CPU Usage:
The top of the report shows your overall TPS and system memory usage.
  1. Call Tree (The Flame Graph):
Expand the percentages on the call tree:
  • Server thread represents total tick time.
  • Look for nodes taking a high percentage (e.g., > 30%).
  • If a specific plugin name appears (e.g. dynmap, WorldGuard, CustomMobs), that plugin is consuming disproportionate tick time.
  • If EntityTick dominates, a massive farm (villagers, cows, zombies) is overloading chunk calculations.

Other Useful Spark Commands

# Check instantaneous TPS and tick durations
spark tps

# Monitor real-time memory and garbage collection activity
spark gc

# Inspect individual worlds and entity counts
spark tickmonitor