Back to all guides
Game Servers

Minecraft Server Performance & Lag Optimization Guide

5 read2026-08-31

Experiencing low TPS (ticks per second), block lag, or stuttering on your Minecraft server? This guide covers the proven optimizations for Paper, Purpur, Java garbage collection, and entity tuning.

1. Optimize Java Launch Flags (Aikar's Flags)

Default Java garbage collection often pauses the server for hundreds of milliseconds. Use Aikar's G1GC Flags to ensure seamless garbage collection:

bash
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui

Rule of Thumb: Set -Xms equal to -Xmx so Java allocates heap memory immediately without resizing lag.

2. Tune server.properties

Open server.properties and adjust these high-impact variables:

ini
view-distance=8
simulation-distance=5
network-compression-threshold=256
  • Reducing simulation-distance to 5 significantly reduces entity and redstone calculations without impacting player sight range.

3. Optimize paper-world-defaults.yml

In your server directory, edit config/paper-world-defaults.yml:

yaml
chunks:
  auto-save-interval: 6000
  max-auto-save-chunks-per-tick: 8
  prevent-moving-into-unloaded-chunks: true

entities:
  spawning:
    despawn-ranges:
      monster:
        soft: 30
        hard: 72

4. Optimize spigot.yml (Entity Activation Range)

Open spigot.yml and tune how far mobs can be before their AI ticks are throttled:

yaml
world-settings:
  default:
    entity-activation-range:
      animals: 16
      monsters: 24
      raiders: 32
      misc: 8
      tick-inactive-villagers: false

5. Diagnose Bottlenecks with Spark

Install the free Spark plugin. In-game, run:

text
/spark profiler --timeout 60

Spark generates an interactive web link showing exactly which plugin, entity type, or redstone contraption is causing TPS drops.

KVM Game VPS

Ready for your own game server?

Launch your own gaming project on our high-performance KVM VPS with maximum AMD Ryzen single-core power, ultra-fast NVMe storage, and real Layer 3/4/7 DDoS protection (PletX & SmartNet). 100% prepaid with no contract lock-in.

AMD Single-Core Power
Datacenter NVMe SSD
4+ Tbps DDoS Protection
100% Prepaid (No Contract)