Godlike
en | USD
Language:
    Currency:

    How to Read a Spark Profiler Report

    kasara

    kasara

    Support Team, Game Specialist
    • 9 min read
    • 234 views
    • 0 likes

    Expert Summary

    In a Minecraft server, multiple issues can cause lag, ranging from things like entities, CPU, memory, garbage collection, and more. The process of simply allocating more memory or storage is not enough, as it won't solve the problem.

    Make your own Minecraft server Minecraft Server Hosting

    Now you can use Spark to find the issue causing lag on your server with the help of its profiling tool. The tool generates a detailed profile of your server, including multiple performance factors and graphs based on its data. Now the key to finding the issue is to go through the nodes of the thread tree in the profile report to view the task/function that is taking the most processing and get to it.

    Also, remember to prefer MSPT (milliseconds per tick) over TPS (ticks per second) when checking the server's performance, as TPS can be manipulated by TPS limiters present on server types like bukkit, paper, and more.

    In simple terms, all the issues causing lag on your server are solvable only if you know what is causing them. So, locate, review, and fix them accordingly.

    Lag is annoying, and the thing that makes it more annoying is the fact that it is caused by multiple underlying reasons you don't even know about. Now imagine increasing your server RAM or storage to reduce lag, but at the end of the day players still experience it due to entity cramming or some other issue.

    Now, to counter that, a performance profiling tool named Spark comes into the picture. Based on that, this guide will be all about understanding, using, and troubleshooting lag on your Minecraft server with the help of Spark so you don't have to wait in long queues for support.

    What is Spark?

    Spark is an advanced diagnostic tool that can be used for your server's profiling, memory inspection, and health reporting. In short, you can easily find the reasons for lag on your Minecraft server that is either caused by CPU/storage, entity cramming, plugins/mods, or other underlying reasons. It works by measuring TPS (ticks per second), CPU/RAM usage, and more to generate a report of your server.

    Understanding TPS (ticks per second) and MSPT (milliseconds per tick)

    Before getting into Spark, we have to get familiar with TPS and MSPT. Below include their working, concept, and differences.

    • TPS (ticks per second): A server calculates in-game time in ticks. Meaning in-game tasks like mob movements, plant growth, day/night cycle, and more depend on ticks, and a server generates a tick every 50 milliseconds or 0.05 seconds, making it a total of 20 ticks in a second. Now a server running on 20 ticks/second or 18 ticks/second will run smoothly, but on the other hand, a server clocking 15 to 10 ticks/second will have a considerable amount of lag due to a delay in the processing of multiple cycles, entities, and machines.
    • MSPT (milliseconds per tick): Similar to ticks per second, MSPT stands for milliseconds per tick and is the total time your server takes to complete a single tick. Since a normal

    server aims to generate a tick in 50 milliseconds (1 second = 1000 milliseconds / 20 ticks), this means a server having MSPT any higher than 50 will start experiencing lag.

    tps mspt ratio

    • Difference: When checking for lag, always prefer MSPT over TPS. Why?! Because server types like Bukkit, Spigot, and Paper include a TPS limiter that works by slowing server processes to prevent them from crashing, ultimately showing a perfect 20/20 TPS while actually running on 10 to 15 TPS.
      Now, MSPT, on the other hand, only shows the total time your server takes to generate a single tick, i.e., 50 MSPT. So, if your server ever shows a perfect 20/20 TPS while having an MSPT of anything above 50, then something needs fixing.

    Generating a Profiler Report with Spark

    Now that you are done understanding the basic terminologies and concepts, you can generate your server's profile using Spark profiler. Now, it basically gives you an overview of your server's performance that's viewable on a web interface. To start it, run the below-mentioned command on your server.

    TIP

    /spark profiler start

    profiler start

    Now allow the profiler to run for a few minutes. The more time you let the profiler run, the more accurate and detailed a report will be generated. Now shortly after that, you can close the profiler, and a unique link to your server's report will be generated. To do that, run the below-mentioned command.

    TIP

    /spark profiler stop

    profiler stop

    Understanding Spark Profiler Report

    Okay! Now that you have successfully generated the report, you can now start finding issues that are causing lag on your server. To start, the first section includes a metrics panel that showcases different performance indicators like TPS, MSPT, CPU, disk, and more.

    Spark UI

    Next you will encounter the information panel that will allow you to view different information and configurations of your server ranging from entity data, plugins/mods, game rules, and more.

    information mobs

    Next you will find a graph that will show you different metrics of your server in fixed intervals that happened during the profiling session. Due to this, we again advise you to leave the profiler running for at least 10 to 20 minutes to get detailed results.

    Note

    In our ATM10 optimization guide, we used Spark profiler to identify the exact lag sources and show how performance issues appear in real server conditions.

    refined graph

    Finally, you will encounter the "All View" section, which will showcase you all the processed threads. Now, a thread is a function that is performing multiple tasks on your server through nodes present in it. In the case of Minecraft servers, only a single thread named "Server Thread" is responsible for running the game.

    Also, to mention, this section is mostly used to identify the factors causing lag on your server.

    allview threads

    To get started, we will start the issue identification process by opening the thread, and, in our case, only the node java.lang.Thread.run() contains more than 99% of the processing.

    allview primaryNodes

    So we will open it further to find out the node that is taking the most processing along with its function with the help of the info point symbol present next to them. Like in the below picture, the MinecraftServer.runServer() is responsible for the tick function along with the server's startup/shutdown.

    allview infoSymbol

    Continuing forward, you will now have to keep expanding the tree to locate the node that is taking the most processing to ultimately find the root cause of lag on your server. Now remember to always view the info symbols to understand the function of the node you are at. You can also check out the official wiki explaining this at Spark

    Garbage Collector and Memory Issues

    The garbage collector is responsible for automatically cleaning all the data that is no longer accessible or needed by your server. In simple terms, Minecraft servers generate temporary data like item drops, entity calculations, and more. This data is stored in the memory of the server till the garbage collector wipes it.

    When the wipe occurs, the entire server needs to be stopped. Now the time required can range anywhere from a few milliseconds to multiple seconds, depending upon your server's memory and the total amount of data to be cleaned. Hence, multiple pauses due to garbage collectors can cause lag.

    Now this is caused by reasons like low memory (RAM), memory leaks, rapid data generation, and more. To fix this, view your GC_active (native) node in the "Server Thread" tree.

    Note

    And if you want to make sure how much RAM do you need - you can use our tool to know exactly how much RAM do you need for a specific modpack server.

    Anything over 5% is concerning and requires you to increase your server memory.

    Similarly, also check for memory leaks that happen when the server generates data but never deletes it. It happens due to reasons like plugin/mod conflicts, entities not despawning, and more. As a result, your server memory usage keeps climbing until it crashes.

    Steps to Detect Lag on your Minecraft Server

    After reading everything, below are the steps to take when facing lag on your server.

    • Start by installing Spark on your server and starting a profiling session for a few minutes to generate a detailed web-based report on your server.
    • Next, check the MSPT (milliseconds per tick); if it is above 50 MSPT, then minor lag can occur, but anything in the range of 80 to 120 can cause major lag on your server.

    Ultimately making it unplayable.

    • Further check the call tree root level and find out which category used the most processing. The categories include plugins/mods, ticking blocks (red stones, plants, etc.), entities, world generation, or others.
    • On finding the category, try to implement appropriate changes to reduce their load accordingly.
    • On implementing changes, run the profiler again. If the MSPT and other performance factors have improved, then your problem is solved; otherwise, there is a chance that you may have multiple sources of lag.

    Resources

    Below include the links to the resources Spark has published. We suggest you give them a visit.

    Conclusion

    Have you tried everything in the guide and are still facing issues?! Then don't worry, we are here to help. Just create a ticket or mail us at support@godlike.host along with a link to your server's profile using Spark. This will make it easier for us to know the problem your server is facing and resolve your issue accordingly.

    FAQ

    • Should I check TPS or MSPT for Minecraft server lag?

      For lag troubleshooting, MSPT is usually more reliable than TPS. TPS can sometimes show 20/20 even when the server is struggling, especially on Bukkit, Spigot, or Paper servers with TPS limiters. MSPT shows how long each server tick takes to process, which makes it a better indicator of real server performance.
    • What is a good MSPT for a Minecraft server?

      A good MSPT is 50 or lower. Minecraft servers are designed to run 20 ticks per second, which means each tick should take no more than 50 milliseconds. If MSPT goes above 50, the server may start lagging. Values around 80–120 MSPT usually indicate serious performance issues.
    • Why is my Minecraft server lagging even with 20 TPS?

      Your Minecraft server can still lag with 20 TPS if the actual tick processing time is too high. Some server software can make TPS appear stable while MSPT shows that the server is overloaded. That is why you should use Spark reports and MSPT data instead of relying only on TPS.
    • Will adding more RAM fix Minecraft server lag?

      Adding more RAM only helps if the lag is caused by low memory, frequent garbage collection, or memory-related issues. If the lag comes from entities, plugins, mods, redstone machines, ticking blocks, or world generation, increasing RAM will not fix the root cause.
    • How do I find which plugin or mod is causing lag?

      Open the Spark report and check the call tree, especially the Server Thread section. Expand the nodes that use the most processing time. If a specific plugin, mod, or function takes a large percentage of server processing, it may be causing lag and should be updated, configured, replaced, or temporarily disabled.
    • What does Server Thread mean in a Spark report?

      Server Thread is the main Minecraft server thread responsible for game logic, ticks, entities, blocks, chunks, plugins, mods, and other server processes. When troubleshooting lag, the Server Thread is usually the most important section to inspect in a Spark profile.
    • What is garbage collection in Minecraft servers?

      Garbage collection is the process of clearing unused temporary data from server memory. During this cleanup, the server may briefly pause. If garbage collection happens too often or takes too long, players can experience lag spikes. High GC activity in Spark may indicate low RAM, memory leaks, or excessive temporary data generation.
    • What should I do if Spark shows high MSPT?

      If Spark shows MSPT above 50, inspect the call tree to find the process using the most server time. Common causes include entities, plugins, mods, ticking blocks, redstone, world generation, and garbage collection. After applying fixes, run Spark again and compare the new report with the previous one.
    • How long should I run Spark profiler?

      You should run Spark profiler for at least a few minutes, but 10–20 minutes is better for accurate results. The profiler should run while the server is under normal load, because this makes it easier to detect the real source of lag.
    • Can Spark be used on Paper, Spigot, Bukkit, Forge, or Fabric servers?

      Yes, Spark can be used on many popular Minecraft server platforms, including Paper, Spigot, Bukkit, Forge, and Fabric. It is especially useful for servers with plugins or mods, where performance issues are harder to identify manually.
    kasara

    kasara

    Support Team, Game Specialist

    Game server support specialist focused on mod configuration, server setup, administration, and technical troubleshooting
    ×

    Report a bug

    Error text

    Your choice