How to Set Up a FiveM Server: Step-by-Step Guide
Complete FiveM server setup guide on REXE VDS: installation, txAdmin configuration, port settings, and performance optimization tips for GTA V roleplay servers.
Causes and solutions for game server lag issues: network latency, server-side lag, TPS drops, MTR testing and FiveM/Minecraft/CS2 optimization guide.
Lag on a game server is one of the most common complaints from players. However, "lag" is not a single problem — it has different types and causes. This guide helps you correctly diagnose lag issues and implement effective solutions.
This is the communication delay between the player's computer and the server. Measured by ping value.
Ping Assessment:
< 20 ms: Excellent (player won't notice)
20-50 ms: Good (acceptable)
50-100 ms: Medium (slight delay may be felt)
100-150 ms: Poor (noticeable delay)
> 150 ms: Very Poor (unplayable)
This is when the server's processing capacity is insufficient. Measured by TPS (Ticks Per Second).
TPS Assessment (Minecraft example):
20 TPS: Excellent (normal)
18-20 TPS: Good
15-18 TPS: Medium (slight lag)
10-15 TPS: Poor (noticeable lag)
< 10 TPS: Very Poor (unplayable)
When some of the sent packets don't reach their destination. Even 1% can cause serious problems.
Packet Loss Assessment:
0%: Excellent
0-1%: Acceptable
1-5%: Problematic
> 5%: Critical (immediate action required)
MTR is a powerful network diagnostic tool that combines traceroute and ping.
# Linux/Mac
mtr --report --report-cycles 100 SERVER_IP
# Example MTR output:
# Host Loss% Snt Last Avg Best Wrst StDev
# 1. 192.168.1.1 0.0% 100 1.2 1.1 0.9 2.1 0.2
# 2. 10.0.0.1 0.0% 100 5.3 5.1 4.8 6.2 0.3
# 3. SERVER_IP 0.0% 100 12.3 12.1 11.8 13.2 0.5
# CPU usage
top
htop
# RAM usage
free -h
# Disk I/O
iostat -x 1
# Network traffic
netstat -s
Symptoms:
- All players experiencing high ping
- Ping is stable but high
- High latency at last hop in MTR
Solution:
- Move server to a location closer to your player base
- Choose Istanbul location for Turkish players
- Get 5-15 ms ping with REXE's Istanbul VDS
# Detect packet loss
mtr --report SERVER_IP
# Which hop has packet loss?
# If loss at last hop: server issue
# If loss at intermediate hop: ISP/routing issue
# Detect abnormal traffic
netstat -an | grep ESTABLISHED | wc -l
tcpdump -i eth0 -n | head -50
# Symptoms:
# - Sudden ping spike
# - All players disconnecting simultaneously
# - Server CPU/RAM normal but inaccessible
# Solution:
# - Immediately notify REXE support team
# - Activate Path.net DDoS protection
# Check CPU usage
top -bn1 | grep "Cpu(s)"
# Which process is consuming CPU?
top -bn1 | head -20
FiveM CPU Optimization:
-- server.cfg
set sv_maxClients 32 -- Limit player count
set onesync_enabled true -- Better performance with OneSync
Minecraft CPU Optimization:
# spigot.yml
world-settings:
default:
mob-spawn-range: 4
entity-activation-range:
animals: 16
monsters: 24
misc: 8
tick-inactive-villagers: false
nerf-spawner-mobs: true
# Check RAM usage
free -h
# If swap usage is high, RAM is insufficient
Minecraft JVM Optimization:
java -Xms4G -Xmx4G \
-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:G1NewSizePercent=30 \
-XX:G1MaxNewSizePercent=40 \
-jar server.jar nogui
# Check disk I/O
iostat -x 1 5
# If %util is high, there's a disk bottleneck
# If await is high, disk is slow
# Solution:
# - Use NVMe SSD (instead of HDD or SATA SSD)
# Minecraft: Timings report
/timings on
# Wait 5 minutes
/timings paste
# Open URL in browser and identify heavy plugins
# FiveM: Resource profiler
resmon start
# Identify heavy resources
-- server.cfg
set sv_maxClients 64
set onesync_enabled true
set onesync_population true
set net_maxPacketSize 1300
# paper.yml
world-settings:
default:
optimize-explosions: true
mob-spawner-tick-rate: 2
max-entity-collisions: 2
despawn-ranges:
soft: 28
hard: 96
# server.cfg
sv_maxrate 786432
sv_maxupdaterate 128
sv_mincmdrate 64
sv_maxcmdrate 128
Upgrade Indicators:
CPU:
- Consistently 80%+ usage
- TPS consistently below 18
- Cannot increase player count
RAM:
- Swap usage present
- OOM (Out of Memory) errors
- Memory leak suspected
Disk:
- %util consistently 80%+
- await > 20ms
- Slow chunk loading
Network:
- Bandwidth limit exceeded
- Packet loss present
- DDoS attacks effective
Diagnose before solving lag issues. Detect network issues with MTR, CPU/RAM issues with top/htop, disk issues with iostat. Optimizations made without knowing the source of the problem are generally ineffective.
REXE's NVMe SSD-based VDS servers and Path.net network infrastructure eliminate the vast majority of game server lag issues. Istanbul location provides 5-15 ms ping values for players in Turkey.
First identify which resource is consuming CPU (resmon command). Disable or optimize heavy resources. Enable OneSync. Keep player count proportional to server capacity. If the problem persists, upgrade to a VDS with a more powerful CPU.
This is usually a disk I/O issue. Check disk usage with the iostat -x 1 command. If you're using HDD or SATA SSD, switching to NVMe SSD makes a big difference. Also check the timings report of plugins — some plugins can cause invisible CPU spikes.
This is a network issue. Run an MTR test and identify which hop has the delay. If the server is outside Turkey, moving to Istanbul location can reduce ping to 5-15 ms for Turkish players. If there's packet loss, notify the REXE support team.
For 128 tick rate on CS2 server, set sv_maxupdaterate 128 and sv_mincmdrate 128. However, 128 tick rate uses approximately 2x more CPU and bandwidth than 64 tick. Make sure your server can handle this load. REXE's VDS servers provide sufficient performance for 128 tick CS2 servers.
Signs of a DDoS attack: sudden and severe ping spike, all players disconnecting simultaneously, server resources (CPU/RAM) appearing normal but inaccessible, abnormal traffic in tcpdump. Normal lag usually increases gradually and is related to CPU/RAM usage. When in doubt, notify the REXE support team.
Complete FiveM server setup guide on REXE VDS: installation, txAdmin configuration, port settings, and performance optimization tips for GTA V roleplay servers.
Complete Minecraft server setup guide on REXE VDS: Paper/Spigot installation, Java configuration, plugin management, and performance optimization for stable gameplay.
Complete CS2 dedicated server setup guide on REXE VDS: SteamCMD installation, GSLT token, server configuration, game modes, and DDoS protection with Path Panel.