# Minecraft Server Performance Optimization Guide (/docs/minecraft/optimize-server)



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

A comprehensive guide to getting the best performance out of your Minecraft Java server. Follow these steps in order — the highest-impact changes are at the top.

<div className="fd-steps">
  <div className="fd-step">
    Use the Right Server Software [#1-use-the-right-server-software]

    | Software   | Performance | Plugins | Mods |
    | ---------- | :---------: | :-----: | :--: |
    | Vanilla    |     Poor    |    ❌    |   ❌  |
    | Spigot     |     Good    |    ✅    |   ❌  |
    | **Paper**  |   **Best**  |    ✅    |   ❌  |
    | Purpur     |     Best    |    ✅    |   ❌  |
    | Pufferfish |     Best    |    ✅    |   ❌  |
    | Forge      |   Moderate  |    ❌    |   ✅  |
    | NeoForge   |   Moderate  |    ❌    |   ✅  |
    | Fabric     |     Good    |    ❌    |   ✅  |

    **Paper is recommended** for nearly all servers. It includes hundreds of optimizations over Vanilla and Spigot at no functional cost. To switch, see [Switch Version](/docs/minecraft/switch-version) or [Install Custom JAR](/docs/minecraft/install-custom-jar).
  </div>

  <div className="fd-step">
    Apply Aikar's JVM Flags [#2-apply-aikars-jvm-flags]

    Java's default garbage collection settings are terrible for Minecraft. **Aikar's Flags** are a community-maintained set of JVM arguments tuned specifically for Minecraft's memory patterns. They dramatically reduce GC pauses and stuttering.

    See [JVM Flags Guide](/docs/minecraft/jvm-flags) for the full flag set and how to apply them.
  </div>

  <div className="fd-step">
    Reduce View & Simulation Distance [#3-reduce-view--simulation-distance]

    This is the **biggest single performance lever** on any Minecraft server. Lowering view distance from 12 to 8 can double your TPS.

    In `server.properties`:

    ```properties
    view-distance=8
    simulation-distance=6
    ```

    | Player Count | Recommended view-distance | Recommended simulation-distance |
    | ------------ | ------------------------- | ------------------------------- |
    | 1–10         | 10                        | 8                               |
    | 10–20        | 8                         | 6                               |
    | 20–50        | 6                         | 4                               |
    | 50+          | 4–6                       | 4                               |

    See [View Distance Guide](/docs/minecraft/render-distance) for details.
  </div>

  <div className="fd-step">
    Don't Over-Allocate RAM [#4-dont-over-allocate-ram]

    > **More RAM is NOT always better.** Over-allocation causes longer garbage collection pauses, which causes server lag.

    Allocate only what you actually need:

    | Players | Recommended RAM |
    | ------- | :-------------: |
    | 1–10    |      2–4 GB     |
    | 10–20   |      4–6 GB     |
    | 20–50   |     6–10 GB     |
    | 50+     |      10+ GB     |

    For modded servers, increase by 2–4 GB depending on mod count. See [How Much RAM](/docs/minecraft/how-much-ram).
  </div>

  <div className="fd-step">
    Pre-Generate Chunks [#5-pre-generate-chunks]

    Chunk generation is the most CPU-intensive task on a Minecraft server. Pre-generating chunks before players arrive eliminates lag spikes when players explore new areas.

    Install the **Chunky** plugin and run:

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

    This generates all chunks within 5000 blocks of spawn. Run it overnight.

    See [Pre-Generate Chunks](/docs/minecraft/pregenerate-chunks) for the full guide.
  </div>

  <div className="fd-step">
    Paper-Specific Optimizations [#6-paper-specific-optimizations]

    If you're running Paper, these settings squeeze out extra performance.

    **`config/paper-world-defaults.yml`:**

    ```yaml
    chunks:
      max-auto-save-chunks-per-tick: 8
      prevent-moving-into-unloaded-chunks: true
    spawn:
      keep-spawn-loaded: false
      keep-spawn-loaded-range: 0
    entity-per-chunk-save-limit:
      experience_orb: 16
      arrow: 16
      snowball: 16
      ender_pearl: 16
    ```

    **`config/paper-global.yml`:**

    ```yaml
    chunk-system:
      gen-parallelism: default
      worker-threads: -1
    ```
  </div>

  <div className="fd-step">
    Spigot/Bukkit Optimizations [#7-spigotbukkit-optimizations]

    In `spigot.yml`:

    ```yaml
    world-settings:
      default:
        mob-spawn-range: 6
        entity-activation-range:
          animals: 16
          monsters: 24
          misc: 8
          water: 12
        merge-radius:
          exp: 6.0
          item: 4.0
    ```

    These reduce mob simulation overhead and merge nearby items/XP orbs.
  </div>

  <div className="fd-step">
    Anti-Lag Plugins [#8-anti-lag-plugins]

    | Plugin                                                                         | Purpose                                                 |
    | ------------------------------------------------------------------------------ | ------------------------------------------------------- |
    | **[Spark](https://spark.lucko.me/)**                                           | Profiler — shows exactly what's causing lag (essential) |
    | **[ClearLagg](https://www.spigotmc.org/resources/clearlagg.68271/)**           | Auto-removes ground items and entities on schedule      |
    | **[FarmControl](https://www.spigotmc.org/resources/farmcontrol.86923/)**       | Limits mob farms to reduce entity counts                |
    | **[LimitPillagers](https://www.spigotmc.org/resources/limitpillagers.84625/)** | Caps pillager outpost spawns                            |
  </div>

  <div className="fd-step">
    Monitor Lag with Spark [#9-monitor-lag-with-spark]

    Install [Spark](/docs/minecraft/setup-spark) and run:

    ```
    /spark tps
    /spark health
    /spark profiler start
    ```

    Wait a few minutes during normal gameplay, then:

    ```
    /spark profiler stop
    ```

    Spark generates a web report showing exactly what's eating your tick time. Common culprits:

    * **Chunk loading** → reduce view-distance
    * **Entity tick** → reduce mob caps or use FarmControl
    * **Pathfinding** → mob farms are spawning too many entities
    * **GC pauses** → apply Aikar's Flags or right-size RAM
  </div>

  <div className="fd-step">
    Schedule Regular Restarts [#10-schedule-regular-restarts]

    Long-running servers accumulate memory fragmentation and minor leaks. Restart every 12–24 hours via **Schedules** in the panel.

    See [Server Restart Schedule](/docs/minecraft/server-restart-schedule).
  </div>
</div>

Quick Wins Checklist [#quick-wins-checklist]

If you only have 15 minutes, do these in order:

1. ✅ Switch to **Paper** (if not already)
2. ✅ Apply **Aikar's Flags**
3. ✅ Lower **view-distance to 8** and **simulation-distance to 6**
4. ✅ Match **RAM** to player count (don't over-allocate)
5. ✅ Install **Spark** to monitor

Most servers see 2–3x TPS improvement from these 5 changes alone.

Related Guides [#related-guides]

* [JVM Flags (Aikar's)](/docs/minecraft/jvm-flags)
* [View Distance / Render Distance](/docs/minecraft/render-distance)
* [Pre-Generate Chunks](/docs/minecraft/pregenerate-chunks)
* [How Much RAM](/docs/minecraft/how-much-ram)
* [Spark Profiler](/docs/minecraft/setup-spark)
* [Types of Server Lag](/docs/minecraft/types-of-server-lag)
* [Server Properties](/docs/minecraft/server-properties)
