An advanced guide to diagnosing server lag (TPS drops) using the Spark profiler.
Spark is a performance profiling plugin/mod that records exactly what your server's CPU is doing. It helps identify which plugin, entity, or mod is causing lag.
If you are using Paper or Purpur, Spark often comes pre-installed or can be easily added.
.jar to your /plugins/ (for Paper/Spigot) or /mods/ (for Fabric/Forge) folder.When your server starts lagging (low TPS), run the following command in-game or in the console:
This will record data for 120 seconds.
Once the profiler finishes, it will generate a link (e.g., https://spark.lucko.me/abc12345). Click this link to open the viewer.
net.minecraft.world.entity is high, you likely have too many mobs or entities in a specific area.bukkit.yml.