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
- Download
sparkfrom spark.lucko.me (available for Paper, Purpur, Fabric, and Forge). - Upload the jar into
/plugins/(or/mods/for Fabric/Forge). - 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
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
https://spark.lucko.me/<unique-id>
How to Read the Spark Web Report
- TPS Graph & CPU Usage:
- Call Tree (The Flame Graph):
Server threadrepresents 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
EntityTickdominates, 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