Direct answer
Start profiling while the lag is happening with /spark profiler start, then finish with /spark profiler stop to open the results. The profiler helps identify where time is being spent, rather than guessing which setting causes lag.
How to check it
- Record TPS/MSPT, player count, and an exact reproduction window.
- Run
/spark profiler startimmediately before reproducing the issue. - After an adequate representative sample, run
/spark profiler stop. Use/spark profiler infoif you are unsure whether profiling is running. - Inspect the viewer for the largest contributors and trace the relevant call stacks. Separate tick-thread work, plugin events, chunk processing and GC rather than assuming one cause.
- For infrequent spikes, see the official
--only-ticks-overflag rather than using an always-on high-overhead trace.
What to change
Fix the confirmed hotspot, ideally on a staging server, by changing one variable at a time. Profile again under comparable conditions. Do not remove plugins or change farm mechanics solely because they appear somewhere in one sample.
Software and version notes
Use the command prefix described by spark for your actual platform. Profiling on Velocity, modded or multithreaded servers may require a different command prefix or thread selection.
Verify the result
Compare representative profiles and the player-visible symptom, not just an idle TPS figure. Keep a record of configuration changes and revert if the fix creates regressions.
References
These sources were checked while preparing this article. Performance behavior and configuration can change between Minecraft/server-software versions, so verify version-specific settings before applying them.
Related articles
Help us improve this article
Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.