How to Optimize Your Minecraft Server Performance

Complete Minecraft server optimization guide covering TPS, MSPT, server.properties, Paper, Spigot, and bukkit.yml tuning, Spark profiler, and pre-generation.

Lag on a Minecraft server can come from many sources — unoptimized settings, too many loaded chunks, entity overload, or running default Vanilla software. This guide covers every optimization layer, from basic settings to advanced config tuning.

Understanding TPS and MSPT

Before optimizing, you need to know how to measure performance.

TPS (Ticks Per Second)

Minecraft runs a game loop at 20 ticks per second. Every tick processes mob AI, block updates, redstone, player actions, and more. When the server can't keep up, TPS drops and the game slows down.

TPSServer Health
20.0Perfect — no lag
18–19.9Minor lag, mostly unnoticeable
15–17.9Noticeable lag — mobs stutter, blocks delay
10–14.9Severe lag
Below 10Unplayable

MSPT (Milliseconds Per Tick)

MSPT measures how long each tick takes to process. To maintain 20 TPS, each tick must complete within 50ms (1000ms ÷ 20 = 50ms).

MSPT is more useful than TPS for early detection — a server at 20 TPS but 48ms MSPT is about to fall behind.

MSPTStatus
0–35msHealthy
35–50msWarning — approaching limit
50ms+Overloaded — TPS dropping

How to Check

  • Paper/Spigot: Run /tps in-game or the console. Shows 1-min, 5-min, and 15-min averages.
  • Paper only: Run /mspt for milliseconds per tick.
  • Spark: Run /spark tps for TPS, MSPT (min/median/95th/max), and CPU usage.

Daily Restarts

The single best thing you can do for stability. Java accumulates memory fragmentation over time, and restarts give the server a fresh start.

Set up a daily restart using Schedules on the XGamingServer panel. For busy servers (20+ players), consider restarting every 12 hours.

Optimizing server.properties

The most impactful vanilla settings. See Configure Your Server for the full reference.

Stop your server

Access the XGamingServer panel and stop your Minecraft server.

Open server.properties

Go to Files and open server.properties.

Update these settings

server.properties
sync-chunk-writes=false
view-distance=8
simulation-distance=6

Save and start

Click Save and start your server.

Player Countsimulation-distanceview-distance
1–581014
6–106810
10–20557
20+345

💡 Tip: Lowering server view distance doesn't have to hurt the player experience. Players can install client-side mods like Distant Horizons or Bobby to render terrain beyond the server's view distance.

Other Useful server.properties Tweaks

SettingRecommendedWhy
sync-chunk-writesfalsePrevents I/O bottleneck on chunk saves
entity-broadcast-range-percentage75100Reduces entity packets sent to clients
pause-when-empty-seconds60Pauses the server when no players are online (1.21.2+)

Enable Aikar's Flags

Aikar's Flags are optimized JVM settings that improve garbage collection and reduce lag spikes. On XGamingServer, enable them from Startup — it's a single toggle.

Pick the Right Server Software

Running the official Vanilla server from Mojang is one of the most common causes of poor performance. Optimized server software makes a huge difference.

  • Paper — Best choice for most servers. Supports plugins, includes major performance optimizations, and bundles Spark profiler (1.21+).
  • Fabric — Lightweight mod loader. Requires performance mods like Lithium to match Paper's optimization.

📝 Note: To change software, see Changing Versions. Do not change if you're running a pre-configured modpack.

Paper Configuration Tuning

Paper uses multiple config files layered on top of server.properties. Each layer adds more granular control.

Config File Hierarchy

FileScopePurpose
server.propertiesServer-wideVanilla Minecraft settings
bukkit.ymlServer-wideMob spawn limits, tick rates
spigot.ymlPer-worldEntity activation ranges, merge radius, tracking
config/paper-global.ymlServer-wideChunk loading, networking
config/paper-world-defaults.ymlPer-world defaultsEntity despawning, tick rates, redstone

bukkit.yml — Mob Spawn Limits

The spawn-limits section controls how many mobs can exist. Lowering these is one of the biggest performance wins.

bukkit.yml
spawn-limits:
  monsters: 50
  animals: 8
  water-animals: 3
  water-ambient: 10
  water-underground-creature: 3
  axolotls: 3
  ambient: 1
SettingDefaultRecommendedNotes
monsters7035–50Biggest performance impact. 50 is a good balance
animals105–8Rarely need the full cap
water-animals53Dolphins, squid
water-ambient2010Fish — cosmetic only
ambient150–1Bats — no gameplay function, safe to disable

spigot.yml — Entity Activation Ranges

Entities outside their activation range skip most AI processing. This is how Paper/Spigot handles thousands of entities efficiently.

spigot.yml
world-settings:
  default:
    entity-activation-range:
      animals: 24
      monsters: 32
      raiders: 48
      misc: 12
      water: 12
      villagers: 24
      flying-monsters: 32
    entity-tracking-range:
      players: 48
      animals: 48
      monsters: 48
      misc: 32
      other: 64
    merge-radius:
      item: 3.5
      exp: 4.0
    tick-inactive-villagers: false
    nerf-spawner-mobs: true
    item-despawn-rate: 4000

Key changes from defaults:

SettingDefaultRecommendedWhy
entity-activation-range.animals3224Animals don't need full range
entity-activation-range.misc1612Item frames, armor stands
entity-activation-range.villagers3224Reduce expensive villager AI
merge-radius.item2.53.5Merge more ground items together
merge-radius.exp3.04.0Merge more XP orbs
tick-inactive-villagerstruefalseDon't tick villagers outside activation range
nerf-spawner-mobsfalsetrueRemove AI from spawner mobs
item-despawn-rate60004000Clean up ground items faster (ticks)

paper-world-defaults.yml — Advanced Tuning

config/paper-world-defaults.yml
chunks:
  max-auto-save-chunks-per-tick: 12
  delay-chunk-unloads-by: 10s
  prevent-moving-into-unloaded-chunks: true
entities:
  spawning:
    per-player-mob-spawns: true
    despawn-ranges:
      monster:
        soft: 28
        hard: 96
misc:
  redstone-implementation: ALTERNATE_CURRENT
environment:
  treasure-maps:
    enabled: false
tick-rates:
  behavior:
    villager:
      validatenearbypoi: 120
  sensor:
    villager:
      secondarypoisensor: 240
collisions:
  max-entity-collisions: 6
SettingDefaultRecommendedWhy
max-auto-save-chunks-per-tick2412Spread autosave load across more ticks
redstone-implementationVANILLAALTERNATE_CURRENTSignificantly more efficient redstone processing
treasure-maps.enabledtruefalseTreasure map searches cause major lag spikes
per-player-mob-spawnstruetrueDistributes mob cap fairly across players
max-entity-collisions86Reduce collision processing in mob farms

Using the Spark Profiler

Spark is a performance profiler that identifies exactly what's causing lag. It comes bundled with Paper since 1.21+ — no installation needed. For other platforms, install it as a plugin/mod.

Quick Health Check

/spark tps
/spark health --upload

This shows current TPS, MSPT, CPU usage, memory, and generates a shareable link.

Profile a Lag Spike

Start profiling

/spark profiler start --timeout 120

Wait for the timeout

Play normally for 2 minutes while Spark collects data.

View results

Spark outputs a link. Open it to see a flame graph — the widest bars are what's consuming the most server time.

Profile Only Lag Spikes

/spark profiler start --only-ticks-over 70 --timeout 300

This only records ticks that take longer than 70ms, filtering out normal operation. Run for 5 minutes during peak hours.

Other Useful Commands

CommandPurpose
/spark tpsCurrent TPS, MSPT, CPU
/spark tickmonitorReal-time tick duration alerts
/spark gcGarbage collection history
/spark heapsummaryMemory usage by object type

Pre-Generate Your World

New chunk generation is one of the biggest performance drains. Pre-generating chunks ahead of time means the server doesn't have to generate terrain on-the-fly as players explore.

Platform-Specific Performance Mods

For mod loader servers, install dedicated performance mods:

Quick Optimization Checklist

  1. Switch from Vanilla to Paper (biggest single improvement)
  2. Enable Aikar's Flags in Startup
  3. Set sync-chunk-writes=false in server.properties
  4. Lower view-distance and simulation-distance based on player count
  5. Reduce spawn-limits.monsters to 50 in bukkit.yml
  6. Set tick-inactive-villagers: false in spigot.yml
  7. Set redstone-implementation: ALTERNATE_CURRENT in paper-world-defaults.yml
  8. Pre-generate your world
  9. Schedule daily restarts
  10. Use /spark health to identify remaining bottlenecks

See also: Configure Your Server | Aikar's Flags | Pre-Generate Chunks | Change View Distance | Fabric Performance Guide

If you need help, join our Discord.

How is this guide?

40% Off — Limited TimeGet your Minecraft server todayInstant setup, DDoS protection, and 24/7 support included.
Get a Server

On this page