Server Performance Optimization
Tips & tricks untuk optimize server Minecraft agar smooth dan cepat
⚠️ Penting
Optimization memerlukan pemahaman teknis. Backup server Anda sebelum membuat perubahan! Jika terjadi kesalahan, Anda bisa restore dari backup.
1. Optimize JVM Arguments
JVM arguments mengontrol bagaimana Java menjalankan server Anda. Update start.sh dengan argumen optimal:
📝 Optimal start.sh untuk server 4GB RAM:
#!/bin/bash
java -Xmx3G -Xms3G -XX:+UseG1GC -XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions -XX:G1NewCollectionPercentage=30 \
-XX:G1MaxNewGenPercent=40 -XX:InitiatingHeapOccupancyPercent=35 \
-XX:+DisableExplicitGC -XX:+ParallelRefProcEnabled \
-Dcom.sun.management.jmxremote=false \
-jar server.jar nogui💡 Tips:
- -Xmx3G = Max heap size (gunakan 75% dari total RAM)
- -Xms3G = Initial heap size (sama dengan -Xmx untuk consistency)
- -XX:+UseG1GC = Use G1 Garbage Collector (best untuk modern Java)
- MaxGCPauseMillis=200 = Target pause time 200ms (kurangi lag)
2. Optimize server.properties
Setting-setting penting di server.properties:
view-distance=10
Chunk render distance. Kurangi ke 8-10 untuk performance lebih baik
simulation-distance=8
Jarak chunk untuk simulasi (mob, crop, water). Optimal: 6-8
max-tick-time=60000
Waktu maksimal per tick. Default 60000ms cukup
entity-broadcast-range-percentage=50
Reduce entity visibility. Kurangi dari 100% ke 50% untuk less lag
network-compression-threshold=256
Compression untuk network packets. Default 256 adalah ok
3. Install Optimization Plugins
Plugin-plugin yang highly recommended untuk performance:
Spark
Real-time performance profiling untuk detect lag cause
/spark profiler startPurpur
Fork dari Paper dengan extra optimization & tweaks
Lithium
Fabric mod untuk optimization (jika pakai Fabric server)
ClearLagg
Auto clear entities dan items yang lama di ground
4. Monitor Performance
Command untuk check server performance:
# Check TPS (Ticks Per Second)
/tps
# Memory usage
/memory
# Entity count
/entitycount
# Chunk info
/chunkinfo
# Performance profiling (jika pakai Spark)
/spark profiler start
/spark profiler stopTarget TPS: 20.0
Jika TPS dibawah 18, ada issue yang perlu di-fix
5. Common Performance Issues
Identify dan fix common problems:
🔴 TPS Drop saat ada players
- → Reduce view-distance & simulation-distance
- → Check untuk redstone machines yang kompleks
- → Check untuk mob farm yang terlalu banyak spawning
🟡 Memory usage naik terus
- → Increase -Xmx value
- → Clear old chunks dengan ClearLagg
- → Check untuk plugin memory leak
🔵 Chunk loading slow
- → Check disk I/O performance
- → Reduce max-tick-time untuk prioritize chunk loading
- → Use SSD untuk server (lebih cepat dari HDD)
6. Best Practices
Tips untuk maintain server performance:
- ✓Regular restart server setiap 24 jam untuk clear memory leaks
- ✓Monitor TPS secara regular dengan /tps command
- ✓Keep paper/server updated ke latest version
- ✓Backup database & world files secara regular
- ✓Use SSD untuk storage (lebih cepat dari HDD)
- ✓Limit plugin quantity - lebih banyak plugin = lebih banyak lag
🚀 Server Teroptimasi!
Server Anda sekarang sudah optimal. Langkah terakhir:
→ Security & Anti-Cheat Setup untuk protect server dari cheater dan hackers
→ Restart server untuk apply semua perubahan
