Minecraft Server Performance Optimization
Complete guide to optimizing your Minecraft server performance. Covers Paper tuning, view distance, pre-generation, Aikar's flags, and lag diagnostics.
Minecraft Server Performance
A smooth server means happy players. This guide covers everything from choosing the right server software to diagnosing and fixing lag on your Minecraft server.
Understanding Server Performance
TPS (Ticks Per Second)
Minecraft runs at 20 TPS (ticks per second). Each tick handles mob AI, block updates, player actions, and world simulation. When TPS drops below 20, the server lags.
| TPS | Experience |
|---|---|
| 20 | ✅ Perfect — no noticeable lag |
| 18-19 | 🟢 Good — very minor delays |
| 15-17 | 🟡 Acceptable — slight delays in mob AI |
| 10-14 | 🔴 Bad — noticeable block placement delay |
| Below 10 | ⛔ Unplayable — severe lag |
MSPT (Milliseconds Per Tick)
Each tick must complete within 50ms (1000ms ÷ 20 TPS = 50ms). If a tick takes longer, TPS drops.
| MSPT | TPS | Status |
|---|---|---|
| Under 50ms | 20 | ✅ Healthy |
| 50-100ms | 10-20 | 🟡 Degraded |
| Over 100ms | Under 10 | 🔴 Critical |
Quick Wins (Do These First)
1. Use Paper Instead of Vanilla
Paper is a drop-in replacement for vanilla Minecraft with massive performance improvements. It optimizes:
- Chunk loading and generation
- Entity AI processing
- Hopper mechanics
- Redstone calculations
- TNT physics
Switching from vanilla to Paper alone can improve TPS by 30-50%.
2. Set Proper View Distance
View distance controls how many chunks are loaded around each player. Lower = better performance.
| View Distance | Loaded Chunks (per player) | Recommended For |
|---|---|---|
| 6 | 169 | Large servers (20+ players) |
| 8 | 289 | Medium servers (10-20 players) |
| 10 | 441 | Small servers (5-10 players) |
| 12+ | 625+ | Very small or well-resourced servers |
Set in your Settings tab or in server.properties:
view-distance=8Tip: Paper also has simulation-distance which controls how far entities (mobs, hoppers) are active. Set it 2-4 chunks lower than view distance.
3. Pre-generate Chunks with Chunky
Chunk generation is the biggest source of lag spikes. Pre-generate your world border area to eliminate this:
- Install the Chunky plugin
- Set a world border:
/worldborder set 10000 - Start pre-generation:
/chunky start - Wait for completion (may take hours for large worlds)
After pre-generation, chunk loading becomes nearly instant.
4. Aikar's Flags (Pre-configured)
All HostedGG servers use Aikar's optimized JVM flags by default. These flags tune Java's garbage collector to minimize lag spikes caused by memory management.
You don't need to configure these — they're already applied to your server.
Paper-Specific Optimization
paper-world-defaults.yml
Key settings to tune in Paper's config:
# Reduce mob spawn rates (biggest performance impact)
spawn-limits:
monster: 50 # default: 70
animal: 8 # default: 10
water-animal: 3 # default: 5
ambient: 1 # default: 15
# Despawn mobs faster
despawn-ranges:
monster:
soft: 28 # start random despawn
hard: 96 # force despawn
# Reduce entity activation range
entity-activation-range:
animals: 16
monsters: 24
misc: 8
# Optimize hoppers (huge impact on redstone-heavy servers)
hopper:
disable-move-event: true
ignore-occluding-block: truepaper-global.yml
# Async chunk loading (already enabled on Paper)
chunk-system:
gen-parallelism: default
io-threads: default
worker-threads: defaultIdentifying Lag Sources
Using Spark (Recommended)
Spark is the best profiler for Minecraft servers:
- Install Spark plugin
- Run
/spark profiler start - Play normally for 5-10 minutes
- Run
/spark profiler stop - Open the generated link to see what's consuming tick time
Common Lag Sources
| Source | Symptoms | Fix |
|---|---|---|
| Chunk generation | Spikes when exploring | Pre-generate with Chunky |
| Too many entities | Gradual TPS decline, mob farms | Reduce spawn limits, add kill timers |
| Hopper chains | Lag near farms/storage | Use disable-move-event: true |
| Redstone machines | Lag near large builds | Limit redstone clock speed |
| Plugin errors | Error spam in console | Update or remove broken plugins |
| Too many players | Consistent low TPS | Upgrade plan or reduce view distance |
| Large world files | Long save times | Set world border, prune unused chunks |
Using Timings
Paper includes a built-in profiler:
- Run
/timings on - Wait 10 minutes during normal gameplay
- Run
/timings paste - Open the generated link
- Look for the highest tick percentages
Plan Sizing Guide
| Server Type | Players | Recommended RAM | Plan |
|---|---|---|---|
| Vanilla SMP | 1-5 | 2 GB | Starter |
| Plugin server with EssentialsX | 5-15 | 4 GB | Standard |
| Semi-vanilla with 10+ plugins | 15-25 | 6 GB | Premium |
| Large network / heavy plugins | 25-40 | 8 GB | Ultimate |
| Light Fabric mods | 2-10 | 2-4 GB | Starter/Standard |
| Forge modpack (light) | 2-5 | 4 GB | Standard |
| Forge modpack (heavy, ATM/RLCraft) | 5-20 | 6-8 GB | Premium/Ultimate |
When to Upgrade
- TPS consistently below 18 after optimization
- RAM usage above 85% during normal play
- Frequent garbage collection pauses visible in Spark reports
- Player complaints about persistent lag
Entity Management
Entities (mobs, items, minecarts, armor stands) are the biggest ongoing performance cost.
Limiting Mob Spawns
Edit Paper's spawn limits (see above) or use plugins:
- ClearLagg — Automatically removes excess entities
- MobLimiter — Per-chunk mob caps
Reducing Item Drops
# In paper-world-defaults.yml
# Items despawn faster
alt-item-despawn-rate:
enabled: true
items:
cobblestone: 300 # 15 seconds (default: 6000 = 5 min)
netherrack: 300
sand: 300
gravel: 300
dirt: 300Farm Optimization
Large mob farms and redstone farms cause the most lag:
- Limit mob farm rates — Don't make infinite spawners
- Use water-based collection instead of hoppers
- Add item merging — Paper has this built-in
- Cap redstone clocks — Fastest viable clock speed, not fastest possible
World Management for Performance
Set a World Border
Unbounded worlds grow forever, increasing file size and backup time:
/worldborder set 20000This limits the world to 10,000 blocks in each direction from spawn — plenty for most servers.
Trim Unused Chunks
If your world is already large, use Chunky to trim chunks outside the world border:
/chunky trimEmergency: Server Is Lagging Badly
Quick recovery steps:
- Restart the server — Clears memory, resets entity cache
- Check console for error spam
- Kill excess entities:
/kill @e[type=!player](⚠️ kills all mobs) - Reduce view distance temporarily to 4-6
- Disable the newest plugin you installed
- Run Spark profiler to identify the cause
Next Steps
- Choose the right server type for your needs
- Install performance-boosting plugins
- Manage your world files and backups
- Troubleshoot specific server issues
Related Blog Posts
Related Articles
Help verify this page
Tested this recently? Send a quick accuracy signal for editors.
Help improve HostedGG
Know this game? Join our community of contributors.
Discussion
Sign in to join the discussion.
Loading discussion...