Transform your laggy Minecraft server into a performance powerhouse with proven optimization techniques. This comprehensive guide covers server software selection, JVM tuning, configuration optimization, plugin management, and emergency lag response strategies.
Server lag is one of the most common challenges Minecraft server administrators face. When your server drops below 20 TPS (Ticks Per Second), gameplay becomes noticeably slower, affecting everything from block breaking to mob movement.
This guide compiles optimization techniques from community resources and real-world testing. Keep in mind that every server is unique—what works for one may not work for another. Testing and fine-tuning these settings in your specific environment is essential.
Understanding the Beast: What Actually Causes Minecraft Server Lag
Before we dive into fixes, let's get real about what's happening when your server starts chugging. Minecraft runs on something called TPS (Ticks Per Second), and ideally, you want that sitting pretty at 20. Think of it like your server's heartbeat—when it drops below 20, everything starts moving in slow motion.
The Three Horsemen of Lag
Through years of troubleshooting, I've found that lag usually comes from three main culprits:
- Entity overload: Dense mob farms with hundreds of entities in small spaces significantly impact server performance.
- Chunk generation: When players explore new areas, your server has to generate fresh terrain on the fly.
- Redstone contraptions: Complex redstone circuits, especially ones with rapid clock signals, can bring even powerful servers to their knees.
Quick Wins: Immediate Optimizations You Can Do Right Now
Let's start with the low-hanging fruit. These changes take minutes but can dramatically improve your server performance.
1. Choose the Right Server Software
Your server software choice fundamentally determines performance potential. Here's the current hierarchy:
Performance Ranking (Best to Worst)
- Purpur: Paper fork with most optimization options. 15-25% better TPS than vanilla.
- Paper: Industry standard. 10-20% better TPS than vanilla. Best plugin compatibility.
- Pufferfish: Paper fork focused on entity/hopper optimizations. Good for technical servers.
- Spigot: Baseline for plugins but lacks modern optimizations.
- CraftBukkit/Bukkit: Outdated. Never use for production.
- Vanilla: Only for specific technical contraptions that require vanilla mechanics.
Software to Avoid:
- Any "premium" or paid server JARs claiming async everything
- Mohist/Magma (Forge+Bukkit hybrids) - unstable and buggy
- Outdated forks no longer maintained
Migration Path: Vanilla → Spigot → Paper → Purpur. Each step maintains compatibility with the previous.
2. Optimize Your View Distance
View distance is the single most impactful setting for server performance. Modern Minecraft allows separate configuration for visual and simulation distances:
# In server.properties (1.18+) view-distance=10 # How far players can see simulation-distance=5 # How far entities/redstone tick # Additional Paper settings (paper-world-defaults.yml) entity-broadcast-range-percentage=100 # Keep at 100 for PvP no-tick-view-distance: 12 # Chunks sent but not ticked
Recommended Configurations by Server Type:
- Survival (20-30 players): view=8, simulation=4
- Creative/Building: view=12, simulation=3
- Minigames/PvP: view=6, simulation=6
- Large Networks (100+ players): view=5, simulation=3
Performance Impact: Each additional chunk in view-distance increases server load exponentially. Reducing from 10 to 8 can improve TPS by 20-30% on busy servers.
3. Pre-generate Your World
Chunk generation is one of the most CPU-intensive operations. Pre-generating eliminates this lag source entirely:
Using Chunky (Recommended)
# Set world border first /worldborder set 10000 # Configure Chunky /chunky radius 5000 /chunky spawn /chunky pattern concentric /chunky quiet 300 # Update every 5 minutes # Start generation /chunky start # Monitor progress /chunky progress
Pre-generation Best Practices:
- Generate during off-peak hours or before server launch
- Use 'quiet' mode to reduce console spam
- Expect ~1-2 hours per 5000 block radius on modern hardware
- Pre-generate all dimensions you're using (nether, end)
- Set world border to match pre-generated area
Performance Impact: Servers with pre-generated worlds see 30-50% TPS improvement during exploration-heavy gameplay.
Advanced Optimization: JVM Arguments and Server Configuration
Now we're getting into the good stuff. These optimizations require a bit more technical knowledge, but the performance gains are worth it.
JVM Flags and Memory Management
JVM tuning is crucial for server performance. The most widely-tested and proven configuration is Aikar's Flags, developed through extensive testing on production servers:
Aikar's Flags (Recommended for Most Servers)
For servers with 6GB+ RAM allocated:
java -Xms6G -Xmx6G -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 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar
For servers with 4GB RAM:
java -Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=20 -XX:G1MaxNewSizePercent=30 -XX:G1HeapRegionSize=4M -XX:G1ReservePercent=15 -XX:InitiatingHeapOccupancyPercent=20 -jar server.jar
Important JVM Guidelines:
- Always set -Xms and -Xmx to the same value to prevent heap resizing
- Never allocate more than 50% of system RAM to Minecraft
- For vanilla/small servers: 2-4GB is usually sufficient
- For modded servers: 6-8GB is typical, more for large modpacks
- Beyond 12GB, diminishing returns occur due to GC overhead
- Use G1GC for any server with 2GB+ RAM (ZGC for 16GB+ on Java 17+)
Paper Configuration Deep Dive
Paper provides extensive optimization options. Here are the most impactful settings for your config/paper-world-defaults.yml:
# Optimized mob spawn limits (balanced for performance)
spawn-limits:
monsters: 50 # Vanilla: 70 (lower for better TPS)
animals: 10 # Vanilla: 10
water-animals: 5 # Vanilla: 5
water-ambient: 10 # Vanilla: 20
ambient: 5 # Vanilla: 15
# Entity activation ranges (in blocks)
entity-activation-range:
animals: 32
monsters: 32
raiders: 48
misc: 16
water: 16
villagers: 32
flying-monsters: 32
tick-inactive-villagers: false # Improves performance
# Hopper optimizations
ticks-per:
hopper-transfer: 8 # Vanilla: 1 (higher = less lag)
hopper-check: 1 # Keep at 1 for item detection
# Crucial performance settings
per-player-mob-spawns: true
alt-item-despawn-rate:
enabled: true
items:
COBBLESTONE: 300 # 15 seconds
NETHERRACK: 300
SAND: 300
GRAVEL: 300
# Reduce lag from redstone
redstone-implementation: ALTERNATE_CURRENT
These settings reduce entity processing overhead. Lower spawn limits and activation ranges can significantly improve TPS, though they may affect mob farm efficiency and gameplay balance. The hopper settings reduce checks from every tick to every 8 ticks, which can help with hopper-heavy builds but may make item transport slightly slower.
Plugin Management: Less Is More
Plugin selection significantly impacts server performance. Feature-heavy plugins with multiple functionalities often consume more resources than specialized, lightweight alternatives.
Additional Paper Configuration Tips
The community recommends these additional settings in paper-world-defaults.yml:
# Prevent players from moving into unloaded chunks prevent-moving-into-unloaded-chunks: true # Disable expensive pathfinding updates update-pathfinding-on-block-update: false # Limit entity collisions max-entity-collisions: 2 # Optimize villager behavior tick-inactive-villagers: false
These settings help reduce unnecessary calculations. Note that disabling villager ticking may affect iron farms and trading hall mechanics.
Essential Performance Plugins
Quality over quantity - these proven plugins actually improve performance:
- Spark: Professional profiler for identifying lag sources. Essential for any server.
- Chunky: Pre-generate worlds efficiently with minimal server impact.
- FarmControl/EntityLimiter: Automatically limit entities per chunk to prevent lag machines.
- ClearLag: Remove ground items and excess entities periodically (configure carefully).
- Tab/TAB-Bridge: Optimized tablist that's lighter than scoreboard plugins.
Using Spark Effectively
Profiling commands for different scenarios:
# General 10-minute profile /spark profiler start --timeout 600 # Check current TPS and memory /spark tps # Analyze specific lag spike /spark profiler start --only-ticks-over 50 # Memory analysis /spark heapdump
Plugins to Avoid:
- Any "clearlag" alternatives that scan chunks constantly
- Plugins that log every block change to MySQL
- Hologram plugins that update frequently
- Anti-cheat plugins known for high CPU usage (test thoroughly)
Hardware Considerations: When Optimization Isn't Enough
Sometimes, you've optimized everything possible and still need more power. That's when hardware matters. Minecraft is heavily single-threaded, meaning CPU clock speed beats core count every time.
This is where Falix's AMD Ryzen 9000 series processors excel. With boost clocks reaching 5.7 GHz, they're optimized for Minecraft's single-thread workload. Modern high-frequency processors generally perform better for Minecraft's single-threaded nature compared to older server processors with more cores but lower clock speeds.
Regional Server Placement
Server location significantly impacts network latency. For globally distributed player bases, utilizing Falix's multi-region infrastructure in North America, Europe, and Asia allows optimal server placement to minimize network lag.
World Settings That Impact Performance
Fine-tuning world settings can dramatically improve performance without affecting gameplay:
Spigot.yml Optimizations
# Entity ranges (reduce for better performance) entity-activation-range: animals: 32 monsters: 32 raiders: 48 misc: 16 # Merge radius (combine items/XP) merge-radius: item: 4.0 exp: 6.0 # Mob spawn range (closer = better performance) mob-spawn-range: 6 # Vanilla: 8 # Growth modifiers (higher = less processing) growth: cactus-modifier: 100 cane-modifier: 100 melon-modifier: 100 mushroom-modifier: 100 pumpkin-modifier: 100 sapling-modifier: 100 wheat-modifier: 100
Bukkit.yml Critical Settings
# Reduce spawn limits for performance spawn-limits: monsters: 50 # Vanilla: 70 animals: 10 # Vanilla: 10 water-animals: 5 # Vanilla: 5 ambient: 5 # Vanilla: 15 # Adjust tick intervals ticks-per: animal-spawns: 400 monster-spawns: 1 # Keep at 1 for proper spawning water-spawns: 1 water-ambient-spawns: 1 ambient-spawns: 1 autosave: 6000 # 5 minutes instead of 5 seconds
Impact Analysis: These settings typically improve TPS by 10-15% with minimal gameplay impact. Monitor mob farm efficiency after changes.
Monitoring and Maintenance: Keeping It Smooth
Proactive monitoring prevents performance degradation over time. Implement these practices:
Daily Monitoring Tasks
- Check TPS trend:
/spark tps(should stay above 19.5) - Monitor memory usage:
/spark gc - Review entity counts:
/paper entity list - Check for chunk issues:
/paper chunk info
Weekly Maintenance Checklist
- Clean player data:
find world/playerdata -mtime +30 -delete # Remove 30+ day old data
- Optimize world files:
/worldborder trim 1000 # Remove chunks 1000+ blocks from border
- Generate performance report:
/spark profiler start --timeout 600 # After 10 minutes, share the link for analysis
- Update software: Check for Paper/Purpur updates (test first!)
- Review logs: Look for errors or warnings indicating issues
Automated Monitoring
Set up these automated tasks for hands-off optimization:
- Schedule entity clearing every 10 minutes (configurable in ClearLag)
- Auto-restart server daily during off-peak hours
- Set up monitoring alerts for TPS drops below 18
- Implement automatic backups with compression
Community Management: The Human Side of Performance
Here's the optimization nobody talks about: educating your players. Create simple rules that prevent lag:
- Limit mob farms to 50 entities per chunk
- Require hoppers to have blocks on top (prevents constant item checks)
- Ban lag machines and infinite redstone loops
- Encourage players to use item frames sparingly
Posting these as "Server Health Guidelines" rather than restrictions helps foster community cooperation. When players understand the performance benefits, compliance typically improves.
Emergency Lag Response: When Things Go Wrong
When your TPS suddenly drops, follow this systematic approach:
Immediate Actions (Under 1 Minute)
- Check TPS:
/spark tpsor/tps - Quick entity scan:
/paper entity list - Emergency entity clear (if critical):
/kill @e[type=!player,type=!villager]
Diagnostic Phase (2-5 Minutes)
- Start profiler:
/spark profiler start --timeout 60 - Check chunk info:
/paper chunk info - List loaded chunks:
/forge chunkinfo(if using Forge) - Check timings:
/timings onthen/timings pasteafter 3 minutes
Common Lag Causes and Fixes
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| TPS drops when players join | Chunk loading | Reduce view-distance temporarily |
| Gradual TPS decline | Entity buildup | Clear ground items, check mob farms |
| Sudden TPS drop in specific area | Redstone/farms | Locate and disable problem contraption |
| Regular TPS spikes | Backup/autosave | Adjust autosave interval, use async backups |
Wrapping Up: Your Path to Lag-Free Gaming
Server optimization is a journey, not a destination. Start with the quick wins, gradually implement advanced optimizations, and keep monitoring your server's health. Remember, every server is unique—what works for a survival server might not work for a minigames network.
The configurations shared in this guide are based on extensive testing and optimization research. These settings have been successfully implemented on servers ranging from small communities to large networks with hundreds of concurrent players.
For specific optimization questions or unique performance challenges, the Falix support team and community are available to assist. Common issues range from entity-related TPS drops to configuration conflicts.
These optimizations can help improve your server's performance, though results will vary based on your hardware, player count, and gameplay style. Remember to test changes incrementally and monitor their impact on both performance and gameplay experience.