Complete guide to maximize your Minecraft server's TPS, reduce lag, and improve player experience with JVM tuning and configuration optimization.
Published: March 5, 2026 | Author: NGP Hosts Team | Tags: optimization performance tuning | Reading time: 10 minutes
Minecraft server performance directly impacts player experience through TPS (Ticks Per Second), lag, and response times. Optimizing your server can transform a laggy experience into smooth gameplay even with dozens of players. This comprehensive guide covers JVM tuning, server configuration, plugin optimization, and hardware considerations for maximum performance.
TPS measures how many game updates occur per second. Ideal TPS is 20.0:
Monitor RAM allocation and garbage collection:
/tps - Check current TPS
/memory - View memory usage
/gc - Manually trigger garbage collection
These JVM arguments provide optimal performance for most servers:
-Xms4G -Xmx4G
-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
Allocate memory based on player count and world size:
-Xms1G -Xmx2G
-XX:+UseG1GC
-XX:+UseStringDeduplication
-XX:+OptimizeStringConcat
-XX:+UseCompressedOops
-XX:+UseCompressedClassPointers
-Xms12G -Xmx16G
-XX:+UseG1GC
-XX:G1HeapRegionSize=16M
-XX:+UseLargePages
-XX:+UseTransparentHugePages
-XX:+AggressiveOpts
Edit your server.properties file for optimal performance:
# Reduce view distance (default 10)
view-distance=6
# Limit simulation distance (1.18+)
simulation-distance=4
# Optimize entity activation
entity-broadcast-range-percentage=80
# Reduce network timeout
network-timeout=30
# Optimize chunk loading
max-chained-neighbor-updates=500
# Limit mob spawning
mob-spawning-range=6
# Optimize world saving
max-tick-time=60000
# Enable optimization for single-threaded servers
enable-jmx-monitoring=false
# Reduce chunk generation delay
max-chained-neighbor-updates=500
# Optimize entity processing
entity-tracking-range=64
# Limit item despawn time
item-despawn-rate=6000
# Optimize redstone
max-redstone-signal-distance=32
# Reduce world border size if not needed
world-border-size=29999984
Automatically removes entities to prevent lag:
/lagg clear - Remove entities
/lagg chunk - Unload chunks
/lagg gc - Force garbage collection
Advanced profiling tool to identify lag sources:
/spark profiler start - Begin profiling
/spark profiler stop --timeout 60 - Stop after 60 seconds
/spark profiler --last - View last profile
For plugins using databases (CoreProtect, LuckPerms):
Generate chunks in advance to prevent lag:
# Using WorldBorder
/worldborder set 5000
/worldborder center 0 0
/worldborder damage amount 0
# Using Chunky plugin
/chunky radius 5000
/chunky start
# Optimize chunk loading
chunk-gc-period-in-ticks=600
# Reduce chunk sending distance
no-view-chunking=true
# Optimize chunk caching
chunk-send-distance=6
# Optimize network compression
network-compression-threshold=256
# Reduce packet size
packet-compression=2
# Optimize connection handling
online-mode=true
# Set appropriate timeout
network-timeout=30
For servers with high player counts, consider BungeeCord/Velocity:
# Set CPU governor to performance
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# Optimize network settings
echo 'net.core.rmem_max = 26214400' | sudo tee -a /etc/sysctl.conf
echo 'net.core.wmem_max = 26214400' | sudo tee -a /etc/sysctl.conf
# Apply changes
sudo sysctl -p
# Built-in commands
/tps - Check server TPS
/lag - View lag information
/memory - Monitor memory usage
/timings - Generate performance report
# External tools
htop - System resource monitor
iotop - Disk I/O monitor
nethogs - Network usage monitor
# Automated backup script
#!/bin/bash
DATE=$(date +%Y%m%d_%H%M%S)
tar -czf backup_$DATE.tar.gz world/
find /path/to/backups/ -name "*.tar.gz" -mtime +7 -delete
/spark profiler to identify lag sources/lagg entitiesFor specific use cases:
# For modded servers
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:-UseAdaptiveSizePolicy
# For minigame servers
-XX:+UseG1GC
-XX:MaxGCPauseMillis=50
-XX:G1HeapRegionSize=4M
If running in Docker:
# Docker compose example
services:
minecraft:
image: openjdk:17
environment:
- JAVA_OPTS="-Xms4G -Xmx4G -XX:+UseG1GC"
ulimits:
nofile:
soft: 65536
hard: 65536
Optimizing a Minecraft server is an ongoing process that requires monitoring, adjustment, and maintenance. Start with the essential JVM flags and server.properties optimizations, then gradually implement advanced techniques based on your server's specific needs. Regular monitoring and maintenance ensure consistent performance as your server grows.
Remember that every server is unique - what works for a small survival server may not suit a large minigame network. Test changes incrementally and always keep backups before major optimizations.
Need better hosting for your optimized server? Try NGP Hosts - Scale from 4GB to 64GB RAM with community rewards!