Back to Blog
guidetips

How to Fix Minecraft Server Lag: Complete Performance Guide (2026)

Fix TPS drops, chunk loading lag, entity lag, and network latency on your Minecraft server. Covers Aikar's flags, plugin optimization, and hardware tuning.

MC-Servers.io
April 18, 202611 min read

Server lag kills player retention faster than anything else. If your server can't maintain 20 TPS (ticks per second), players will leave. This guide covers every type of Minecraft server lag and how to fix it — from quick wins to advanced optimization.

Understanding Server Lag Types

Not all lag is the same. Diagnosing the type helps you fix it faster:

TPS lag (server-side): The server can't process game ticks fast enough. Blocks break slowly, mobs stutter, and everything feels sluggish for ALL players. Check with /tps — anything below 18 is noticeable, below 15 is unplayable.

Network lag (latency/ping): Data takes too long to travel between the player and server. Affects individual players based on their distance and connection quality. Check with /ping.

Client-side lag (FPS): The player's computer can't render the game fast enough. Not a server issue — players need to lower their video settings or install OptiFine/Sodium.

Step 1: Use Aikar's JVM Flags

This is the single most impactful optimization. Aikar's flags optimize Java's garbage collector for Minecraft's specific memory patterns. Add these to your server startup script:

java -Xms10G -Xmx10G -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

Replace 10G with your available RAM (leave 1-2GB for the OS). Never set Xms lower than Xmx — Aikar's flags need a fixed heap size.

Step 2: Use Paper or Purpur (Not Vanilla/Spigot)

If you're running vanilla or Spigot, switch to Paper or Purpur immediately. Paper includes dozens of performance patches that dramatically reduce TPS lag: async chunk loading, entity activation ranges, optimized redstone, better mob AI, and more. Purpur adds even more optimizations and configuration options on top of Paper. Both are drop-in replacements — just swap the jar file.

Step 3: Optimize server.properties

view-distance=6 — Reduce from default 10. This is the biggest performance setting. Each additional chunk of view distance increases load exponentially. 6 is a good balance between performance and visibility.

simulation-distance=4 — How far entities and redstone are processed. Lower than view distance for huge savings.

network-compression-threshold=256 — Compress packets larger than 256 bytes. Reduces bandwidth usage.

Step 4: Optimize Paper/Purpur Config

Key settings in paper-world-defaults.yml:

entity-activation-range: animals: 16, monsters: 24, misc: 8 — Mobs far from players are "deactivated" and skip AI ticks.

max-entity-collisions: 2 — Prevents lag from packed animal farms.

despawn-ranges.soft: 28, hard: 96 — Mobs despawn faster, reducing entity count.

anti-xray.enabled: true — Prevents X-ray cheating. Use engine-mode 2 for best protection (slight CPU cost).

Step 5: Fix Entity Lag

Entities (mobs, items, armor stands) are the #1 cause of TPS lag. Use the /spark profiler command to identify entity-heavy chunks.

Limit mob farms: Cap mobs per chunk using Paper's spawn limits. Set mob-spawn-range to 3-4.

Clear items: Use ClearLag or Paper's built-in item despawn settings to remove dropped items faster.

Villager optimization: Villagers are notoriously laggy due to their complex AI. Limit villager counts per chunk, use the Villager Optimizer plugin, or replace villagers with custom shop GUIs (like ShopKeepers).

Hopper lag: Hoppers check for items every tick. Use Paper's hopper-check setting to slow them down, or replace hopper chains with water streams.

Step 6: Pregenerate Your World

Chunk generation is extremely CPU-intensive. Pregenerate your world before opening to players:

Install the Chunky plugin. Run /chunky radius 5000 and /chunky start. Let it run until complete (can take hours for large worlds). This eliminates chunk-generation lag during gameplay.

Step 7: Monitor with Spark

Spark is the essential profiling plugin for Minecraft servers. Install it and use:

/spark profiler start — Run during lag, then /spark profiler stop. It generates a detailed report showing exactly what's causing lag.

/spark tps — Real-time TPS monitoring with history.

/spark health — CPU, RAM, and disk usage overview.

Step 8: Plugin Audit

Poorly coded plugins are a common lag source. Use Spark's profiler to identify which plugins consume the most CPU. Common offenders: custom enchant plugins, scoreboards that update every tick, chat plugins with complex formatting, and logging plugins that write to disk frequently. Remove or replace laggy plugins — check their Spark profiles before and after.

Hardware Recommendations

CPU: Minecraft is single-threaded for the main game loop. A fast single-core CPU matters more than many cores. Intel i9 or AMD Ryzen 9 with high clock speed is ideal.

RAM: 4GB for small servers (10 players), 6-8GB for medium (20-50), 10-16GB for large (50-100+). Don't allocate more than you need — excessive RAM causes longer garbage collection pauses.

Storage: NVMe SSD is essential for chunk loading. Never run a server on a HDD.

Network: 100Mbps minimum, 1Gbps preferred. Low latency matters more than bandwidth.

For hosting recommendations, see our server hosting comparison. Once your server is running smoothly, list it on MC-Servers.io to attract players.

Find Your Next Server

Browse thousands of Minecraft servers with real-time player counts, uptime stats, and community votes.