# How to Fix 'Can't Keep Up' and Tick Loop Crashes on Your Minecraft Server (/docs/minecraft/fix-server-tick-loop)



import { Step, Steps } from 'fumadocs-ui/components/steps';

**"Can't keep up! Is the server overloaded?"** means your server is falling behind on game ticks (Minecraft runs 20 ticks per second; missing this target = lag). When the lag is severe enough — or a single tick takes longer than `max-tick-time` (60 seconds by default) — the watchdog kills the server with an **"Exception in server tick loop"** crash.

This guide covers both the warning and the crash. The fix process is the same: find what's eating tick time, then reduce it.

Symptoms [#symptoms]

| Symptom                                            | Severity                                        |
| -------------------------------------------------- | ----------------------------------------------- |
| Occasional "Can't keep up" during world generation | Normal — ignore                                 |
| Constant "Can't keep up" during gameplay           | Bad — fix the underlying lag                    |
| TPS below 15 in `/spark tps`                       | Bad — players will feel it                      |
| `Exception in server tick loop` crash              | Critical — server died                          |
| `Watchdog Thread/ERROR` in logs                    | Critical — single tick exceeded `max-tick-time` |

Diagnose with Spark [#diagnose-with-spark]

The fastest way to find what's causing tick lag is the **Spark** profiler.

<Steps>
  <Step>
    Install Spark [#install-spark]

    Drop the [Spark](https://spark.lucko.me/) JAR into your `plugins/` (Paper/Spigot) or `mods/` (Forge/Fabric) folder and restart. Full guide: [Setup Spark](/docs/minecraft/setup-spark).
  </Step>

  <Step>
    Check current TPS [#check-current-tps]

    In **Console** or in-game:

    ```
    /spark tps
    ```

    If TPS is below 18 sustained, you have a problem.
  </Step>

  <Step>
    Run a profiler [#run-a-profiler]

    ```
    /spark profiler start
    ```

    Wait 2–5 minutes during normal gameplay (or during the lag spike), then:

    ```
    /spark profiler stop
    ```

    Spark generates a web link. Open it.
  </Step>

  <Step>
    Read the report [#read-the-report]

    Look for the largest **self-time** entries. Common culprits:

    | What you see                         | Cause                                        |
    | ------------------------------------ | -------------------------------------------- |
    | `ServerChunkCache.tick` / `ChunkMap` | Too many loaded chunks — lower view-distance |
    | `EntityType.tick` for one type       | Mob farm — too many of that mob              |
    | `LevelChunk.tickBlocks`              | Heavy redstone or fluid ticks                |
    | A specific plugin/mod class          | That plugin/mod is the problem               |
    | `GarbageCollector`                   | RAM pressure — increase RAM or fix leak      |
  </Step>
</Steps>

Common Causes and Fixes [#common-causes-and-fixes]

Too Many Entities (Mob Farms) [#too-many-entities-mob-farms]

Big mob farms with hundreds of mobs are the #1 lag source on most servers.

**Fix:**

* Install **[ClearLagg](https://www.spigotmc.org/resources/clearlagg.68271/)** to auto-clear ground items and entities
* Install **[FarmControl](https://www.spigotmc.org/resources/farmcontrol.86923/)** to cap mob farms
* Lower entity activation range in `spigot.yml`:

```yaml
entity-activation-range:
  animals: 16
  monsters: 24
  misc: 8
```

* Reduce `mob-spawn-range` in `spigot.yml` from 8 to 6
* Set per-chunk entity caps in `paper-world-defaults.yml`

See [Mob Spawn Rate](/docs/minecraft/change-mob-spawn-rate).

Chunk Generation Lag [#chunk-generation-lag]

When players explore new areas, the server generates new chunks — which is **the most CPU-intensive** thing Minecraft does.

**Fix:** Pre-generate the world with [Chunky](/docs/minecraft/pregenerate-chunks):

```
/chunky radius 5000
/chunky start
```

Run overnight before opening the server to players.

Heavy Redstone [#heavy-redstone]

Large redstone machines (item sorters, factory contraptions, music boxes) can eat 50% of a tick on their own.

**Fix:**

* Use Paper's redstone optimizer (`config/paper-world-defaults.yml` → `redstone-implementation: ALTERNATE_CURRENT`)
* Switch to a redstone-optimized JAR like [Purpur](/docs/minecraft/install-custom-jar)
* Simplify or remove the worst offender (Spark will name the chunk)

Bad Plugin or Mod [#bad-plugin-or-mod]

A single broken plugin or mod can tank an entire server.

**Fix:** Read the Spark profiler — it names the plugin/mod by package. Update or remove it.

Insufficient RAM (GC Pauses) [#insufficient-ram-gc-pauses]

If GC pauses are eating tick time, you'll see `GarbageCollector` near the top of Spark.

**Fix:**

* Apply [Aikar's Flags](/docs/minecraft/jvm-flags)
* **Right-size** your RAM (see [How Much RAM](/docs/minecraft/how-much-ram)) — both too little and too much cause issues
* Find memory leaks with `/spark heapdump`

High View-Distance [#high-view-distance]

View-distance has a quadratic effect on chunk count and a linear effect on per-tick work.

**Fix:** Lower `view-distance` to 6–8 and `simulation-distance` to 4–6 in `server.properties`. See [Render Distance](/docs/minecraft/render-distance).

Stop Watchdog Crashes (Exception in server tick loop) [#stop-watchdog-crashes-exception-in-server-tick-loop]

When a single tick exceeds `max-tick-time` (default 60000 ms = 60 seconds), the watchdog kills the server.

Temporary workaround [#temporary-workaround]

Increase or disable the watchdog in `server.properties`:

```properties
max-tick-time=120000
```

Or to disable entirely (**not recommended**):

```properties
max-tick-time=-1
```

> **Warning:** Raising `max-tick-time` doesn't fix the lag — it just hides the symptom. Use it as a temporary measure while you find the real cause with Spark.

Real fix [#real-fix]

Find the operation that took 60+ seconds in **Console** at the time of the crash. The watchdog logs a thread dump showing exactly what was running. Common culprits:

* A plugin loop with no exit condition
* A worldedit operation on millions of blocks
* A mod doing synchronous I/O on the main thread
* A broken pathfinding loop on a huge mob

Quick Wins Checklist [#quick-wins-checklist]

1. ✅ Lower `view-distance` to 8, `simulation-distance` to 6
2. ✅ Apply Aikar's Flags
3. ✅ Pre-generate chunks with Chunky
4. ✅ Install Spark and identify the top offender
5. ✅ Switch to Paper if not already
6. ✅ Install ClearLagg + FarmControl

Most servers see a 2–3× TPS improvement from these alone.

Common Mistakes [#common-mistakes]

| Mistake                              | Fix                                                    |
| ------------------------------------ | ------------------------------------------------------ |
| Increasing RAM as the first response | RAM rarely fixes tick lag — find the cause first       |
| Disabling the watchdog               | Hides the problem, doesn't fix it                      |
| Removing all plugins                 | The problem is usually one plugin — Spark will name it |
| Ignoring "Can't keep up" warnings    | They're a leading indicator of a future crash          |
| Restarting in a loop                 | Fix the cause — restarts won't help                    |

Related Guides [#related-guides]

* [Optimize Server](/docs/minecraft/optimize-server)
* [Setup Spark](/docs/minecraft/setup-spark)
* [Types of Server Lag](/docs/minecraft/types-of-server-lag)
* [Pre-Generate Chunks](/docs/minecraft/pregenerate-chunks)
* [JVM Flags](/docs/minecraft/jvm-flags)
* [Render Distance](/docs/minecraft/render-distance)
* [Mob Spawn Rate](/docs/minecraft/change-mob-spawn-rate)
