Tutorials

Performance Optimization

Optimize your Minecraft server for better performance and higher TPS.

Server performance directly impacts player experience. This guide covers optimization techniques to achieve smooth gameplay with consistent 20 TPS.

Understanding TPS

TPS (Ticks Per Second) measures server performance. Minecraft runs at 20 TPS by default:

TPSStatusPlayer Experience
20PerfectSmooth, no lag
18-19GoodMinor delays, mostly unnoticeable
15-17AcceptableSome lag, block delays
10-14PoorNoticeable lag, mob delays
<10CriticalSevere lag, nearly unplayable

Server Software

Your choice of server software significantly impacts performance:

Paper (Recommended)

Highly optimized fork of Spigot. Best performance for most servers. Includes async chunk loading and many optimizations. Available directly in HostMode.

Spigot

Original plugin platform with performance improvements over vanilla. Good plugin compatibility. Available directly in HostMode.

Vanilla

Unoptimized. Only use for testing or when plugin compatibility requires it. Available directly in HostMode.

Purpur / Pufferfish

Advanced Paper forks with extra optimizations. For manual installation: create a Paper server, then replace the JAR via the Files page.

View Distance Optimization

View distance is the biggest performance factor. Lower values significantly reduce load:

server.properties
# Recommended settings
view-distance=8
simulation-distance=6
View DistanceChunks Loaded (per player)Use Case
6169Large servers, 50+ players
8289Medium servers, 20-50 players
10441Small servers, 10-20 players
12+625+Private servers, <10 players

Paper Configuration

Optimize Paper's configuration files for better performance:

paper-world-defaults.yml

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

entities:
  armor-stands:
    tick: false

spawn-limits:
  monsters: 50
  animals: 8
  water-animals: 3
  water-ambient: 5
  ambient: 1

tick-rates:
  behavior:
    villager:
      validatenearbypoi: 60
  sensor:
    villager:
      secondarypoisensor: 80

paper-global.yml

chunk-loading:
  autoconfig-send-distance: true
  enable-frustum-priority: false
  global-max-chunk-load-rate: 300.0
  global-max-chunk-send-rate: 150.0
  global-max-concurrent-loads: 6.0
  max-concurrent-sends: 2
  min-load-radius: 2
  player-max-chunk-load-rate: -1.0
  player-max-concurrent-loads: 20.0
  target-player-chunk-send-rate: 100.0

Mob & Entity Optimization

Entities are often the biggest performance drain:

Mob Spawn Limits

bukkit.yml
spawn-limits:
  monsters: 50      # Default: 70
  animals: 8        # Default: 10
  water-animals: 3  # Default: 5
  water-ambient: 5  # Default: 20
  water-underground-creature: 3
  axolotls: 3
  ambient: 1        # Default: 15

Entity Activation Range

spigot.yml
entity-activation-range:
  animals: 16          # Default: 32
  monsters: 24         # Default: 32
  raiders: 48
  misc: 8              # Default: 16
  water: 8             # Default: 16
  villagers: 16        # Default: 32
  flying-monsters: 32
  villagers-work-immunity-after: 100
  villagers-work-immunity-for: 20
  villagers-active-for-panic: true
  tick-inactive-villagers: false
  wake-up-inactive:
    animals-max-per-tick: 4
    animals-every: 1200
    animals-for: 100
    monsters-max-per-tick: 8
    monsters-every: 400
    monsters-for: 100
    villagers-max-per-tick: 4
    villagers-every: 600
    villagers-for: 100
    flying-monsters-max-per-tick: 8
    flying-monsters-every: 200
    flying-monsters-for: 100

Memory Optimization

Proper memory configuration prevents lag spikes from garbage collection:

Memory Warning

Never allocate more than 10-12GB to a single server. The garbage collector becomes less efficient with larger heaps. For more RAM, use multiple servers behind a proxy.

Recommended JVM Flags

Aikars Flags (Recommended)
java -Xms8G -Xmx8G -XX:+UseG1GC -XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC -XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M -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 -jar server.jar nogui

Pre-generating Chunks

Pre-generate world chunks to avoid lag when players explore:

  1. Install Chunky plugin from the Plugins page
  2. Set the world border: worldborder set 10000
  3. Start generation: chunky start
  4. Monitor progress in console

Pro Tip

Pre-generate during low activity hours. Chunk generation is CPU-intensive and will impact player experience while running.

Profiling & Diagnostics

Use these tools to identify performance issues:

ToolCommandPurpose
Spark/spark profilerCPU and memory profiling
Spark TPS/spark tpsDetailed TPS analysis
Timings/timings reportPaper's built-in profiler
GC Log-Xlog:gc*Garbage collection analysis