---
title: "Find the cause of lag with the spark profiler"
url: https://help.endercloud.in/docs/find-lag-with-spark-profiler
category: "Minecraft Hosting › Troubleshooting & Performance"
type: Guide
tags: ["lag", "performance", "plugins"]
keywords: "spark, spark profiler, spark tps, spark health, spark profiler start, spark profiler stop, mspt, lag spikes, what is causing lag, timings, timings report, heapsummary, profiler link, find lag, lag cause, lag finder, how to use spark, spark report, check tps, tps command, what causes lag"
difficulty: intermediate
time: "15 minutes"
updated: 2026-11-14
source: Endercloud Knowledge Base (official)
---

# Find the cause of lag with the spark profiler

> spark records what your server spends its time on and gives you a link to a report. Use /spark tps, /spark health and /spark profiler to find the plugin, mod or entity behind your lag.

spark is a free performance tool for Minecraft servers. It records what the server is doing for a few minutes and gives you a web link with a detailed report, so you can see which plugin, mod, entity or task is causing lag. It replaces the old Timings reports.

## Step 1: Get spark

-   **Paper** (the default software on a new Endercloud server) and **Purpur**, which is based on Paper: spark is already built in on current versions. Nothing to install; just type the commands below.
    
-   **Very old Paper builds, Spigot, Fabric, Forge or NeoForge**: install spark from **Plugins** → **Browse Plugins** or **Mods** → **Browse Mods** (search "spark", then **Install**), or download it from [spark.lucko.me](https://spark.lucko.me) and upload it with **Files**. Restart the server.
    

Commands below can be typed in the **Console** without the slash (for example `spark tps`), or in game with a slash if you are an operator.

## Step 2: Take a quick health check

```
/spark tps
```

Shows TPS over the last few seconds and minutes, plus **MSPT** (milliseconds per tick) and CPU use. 20 TPS and MSPT under 50 ms means the server is keeping up. If MSPT is often above 50, the server is lagging.

```
/spark health
```

Gives an overview of TPS, MSPT, CPU, memory and disk. Use it to check whether memory is nearly full or the CPU is at its limit.

## Step 3: Run the profiler while the lag happens

The profiler is only useful when it records the lag, so run it while players are online and the server feels slow.

1.  Start it with a time limit (here 5 minutes):
    
    ```
    /spark profiler start --timeout 300
    ```
    
2.  Keep playing normally. When the time is up, spark posts a link in chat and in the Console.
    
3.  If you started it without a timeout, stop it yourself to get the link:
    
    ```
    /spark profiler stop
    ```
    

For short lag spikes, record only the slow ticks. This example only keeps ticks that took longer than 100 ms:

```
/spark profiler start --only-ticks-over 100 --timeout 600
```

## Step 4: Read the report

1.  Open the link. You will see a tree of what the server did, with a percentage next to each line.
    
2.  Expand the main **Server thread**. This is where TPS lag comes from.
    
3.  Keep expanding the lines with the biggest percentages until you reach names you recognise: a plugin or mod name, an entity type, or a task.
    
4.  The viewer can also group the time by plugin or mod, which is the quickest way to spot one that uses far more than the others.
    

| What you see taking the most time | What to do |
| --- | --- |
| One plugin or mod | Update it, check its settings, or replace it. |
| Entity ticking (mobs, villagers, items) | Find and shrink big farms; lower simulation distance; tune entity settings in [Paper's config](/docs/optimise-paper-and-purpur-settings). |
| World or chunk generation | [Pregenerate the world with Chunky](/docs/pregenerate-your-world-with-chunky) and add a world border. |
| Hoppers, redstone or block entities | Look for large hopper chains and fast redstone clocks. |
| Garbage collection or memory | Memory may be too tight. See [OutOfMemoryError](/docs/outofmemoryerror-java-heap-space). |

## Step 5 (optional): Check memory use

```
/spark heapsummary
```

Uploads a summary of what is using memory. Run it when few players are online, as it does extra work on a busy server.

> **Note:**
> Anyone with a spark link can view the report. That is fine for sharing with support or a plugin author, but don't post links in public places if your server is private.

## Frequently asked questions

**Q: I get "Unknown command" when I type /spark**

Your software doesn't include spark (for example Fabric, Forge or Spigot). Install the spark plugin or mod (Step 1), restart, and try again. On Paper you shouldn't need to. In game you also need to be an operator or have the `spark` permission.

**Q: TPS is 20 but players still say it lags**

Then the server is keeping up and the problem is probably ping or FPS. See [How to fix Minecraft server lag](/docs/how-to-fix-minecraft-server-lag).

**Q: Can Endercloud read my spark report?**

Yes, send the link in a ticket and we will point you in the right direction. We help with the hosting side; changing a plugin's code is up to its author.
