CRAFTUTILS

Server Optimization Guide

Reduce lag and get the most out of your Minecraft server hardware.

Choose the right server software

Vanilla Minecraft’s built-in server is unoptimised. For any serious server, use a fork:

  • Paper— the most popular choice. Includes significant performance patches, async chunk loading, and a plugin API compatible with Bukkit and Spigot plugins.
  • Purpur— a Paper fork with even more configuration options and gameplay tweaks. Good for servers that want fine-grained control.
  • Fabric— a lightweight mod loader. Combined with optimisation mods like Lithium, Starlight and FerriteCore, it can match or beat Paper’s performance while keeping closer to vanilla behaviour.

Use the Start File Generator to create a start script with optimised JVM flags for your chosen platform.

JVM flags

The Java Virtual Machine flags in your start script have a major impact on garbage collection pauses (the main cause of server “lag spikes”). The two most popular flag sets are:

  • Aikar’s flags— the standard recommendation for most servers. They tune the G1 garbage collector to avoid long pauses. There are two variants: one for servers with under 12 GB of RAM and one for 12 GB+.
  • GraalVM flags— if you run GraalVM instead of HotSpot, these enable the JVMCI compiler for better peak throughput. Only use these if you’ve actually installed GraalVM.

As a rule, allocate 4–6 GB for a small server (1–10 players) and 8–12 GB for larger ones. Don’t allocate more RAM than your machine has free — the OS and the JVM itself need headroom.

server.properties tuning

These settings have the biggest impact on performance:

  • view-distance— the number of chunks sent to each player. Vanilla defaults to 10; reducing it to 6–8 dramatically cuts chunk generation and network load. Players won’t notice the difference in most gameplay.
  • simulation-distance(1.18+) — how far from the player entities tick. Setting this to 4–6 is a huge win because it means distant redstone, mob AI and block updates simply don’t run.
  • network-compression-threshold— set to 256 (default is 256 on Paper, but check). Compresses large packets without wasting CPU on tiny ones.

Paper-specific settings

If you’re running Paper, these config files offer extra tuning:

  • paper-global.yml — set max-auto-save-chunks-per-tickto 6–8 to spread world saves over more ticks, reducing lag spikes during autosave.
  • paper-world-defaults.yml — reduce mob-spawn-range and tweak despawn-ranges to cut the number of active mobs. This is often the single biggest performance improvement.
  • Enable per-player-mob-spawns(on by default in recent Paper) to prevent one player’s loaded chunks from eating the entire mob cap.

Pre-generating the world

Chunk generation is the most expensive operation a server does. Use a plugin like Chunky to pre-generate a world border’s worth of chunks before players join. A 5,000-block radius covers most survival needs and eliminates generation lag during gameplay.

Monitoring performance

Use /tpsto check your server’s ticks per second (20.0 is perfect). If it drops below 18, you have a problem. Paper also provides /timingsand Spark profiler support to identify exactly what’s causing lag. Use the Tick Calculator to convert between ticks and real time when reading profiler output.