Game Server Network Optimization: Reduce Latency, Configure UDP, and Tune Kernel Parameters

Network latency is the silent killer of game server performance. You can have the fastest CPU and the most RAM, but if your network stack is misconfigured, players experience rubber-banding, delayed hit registration, and disconnects. This article covers the Linux kernel parameters, UDP tuning, and network architecture decisions that reduce latency and improve player experience on dedicated game servers.

Before tuning your network, check our dedicated server comparison table to ensure your hardware includes adequate bandwidth and DDoS protection for game hosting.

Why Game Servers Are Sensitive to Latency

Unlike web servers, which can tolerate 100–200ms of latency, game servers need sub-50ms round-trip times for competitive play. Every millisecond of delay between a player’s action and the server’s response degrades the experience. First-person shooters are the most sensitive: a 30ms delay in hit registration makes the difference between a headshot and a miss. Survival games and MMOs are more forgiving but still benefit from low latency.

UDP vs TCP: Why Game Servers Use UDP

Nearly all game servers use UDP for real-time game traffic. The reason is simple: UDP has no handshake, no acknowledgment, and no retransmission overhead. If a packet is lost, it is lost — the game continues with the next update. TCP’s reliability features (retransmission, in-order delivery, flow control) add latency that is catastrophic for real-time games. A single lost TCP packet can stall the entire data stream for 200ms while the retransmission timer fires.

Some game servers use TCP for non-real-time traffic (authentication, chat, leaderboards) and UDP for game state updates. This hybrid approach is common in games like Minecraft (TCP for game state, with optional UDP for voice chat) and Rust (UDP for game state, TCP for RCON).

Linux Kernel Network Tuning

The default Linux kernel network settings are conservative — optimized for web servers, not game servers. Apply these changes to /etc/sysctl.conf and reload with sysctl -p:

UDP Buffer Sizes

# Increase UDP receive and send buffer sizes
net.core.rmem_max = 134217728
net.core.wmem_max = 134217728
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.ipv4.udp_mem = 262144 327680 393216
net.ipv4.udp_rmem_min = 16384
net.ipv4.udp_wmem_min = 16384

These settings increase the maximum UDP buffer from the default 212 KB to 128 MB, preventing buffer overflows during traffic spikes (e.g., 50 players connecting simultaneously after a server restart).

TCP Tuning for Non-Real-Time Traffic

# TCP optimizations for RCON and admin traffic
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.core.netdev_max_backlog = 5000
net.core.somaxconn = 1024

Congestion Control

Switch from the default cubic to BBR for better throughput on high-bandwidth links:

# Enable BBR congestion control
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

BBR is particularly effective on dedicated servers with 1 Gbps+ connections, reducing bufferbloat and improving throughput under load.

Firewall Configuration for Game Servers

Game servers need specific UDP ports open. Use iptables or nftables to allow only the necessary ports and block everything else:

# Allow established connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

# Game-specific UDP ports
# Rust
iptables -A INPUT -p udp --dport 28015 -j ACCEPT
# ARK: Survival Ascended
iptables -A INPUT -p udp --dport 7777 -j ACCEPT
iptables -A INPUT -p udp --dport 7778 -j ACCEPT
# Palworld
iptables -A INPUT -p udp --dport 8211 -j ACCEPT
# Valheim
iptables -A INPUT -p udp --dport 2456:2457 -j ACCEPT
# 7 Days to Die
iptables -A INPUT -p udp --dport 26900:26902 -j ACCEPT

# RCON (TCP)
iptables -A INPUT -p tcp --dport 28016 -j ACCEPT

# SSH
iptables -A INPUT -p tcp --dport 22 -j ACCEPT

# Drop everything else
iptables -P INPUT DROP

Rate Limiting to Prevent DDoS

Even with provider-level DDoS protection, rate limiting at the server level adds a layer of defense:

# Limit UDP connections per IP to prevent flooding
iptables -A INPUT -p udp -m state --state NEW \
  -m hashlimit \
  --hashlimit-name udp_limit \
  --hashlimit-above 100/second \
  --hashlimit-burst 200 \
  --hashlimit-mode srcip \
  -j DROP

# Limit new TCP connections (SSH brute force protection)
iptables -A INPUT -p tcp --dport 22 \
  -m state --state NEW \
  -m recent --set \
  -m recent --update --seconds 60 --hitcount 4 \
  -j DROP

Network Interface Card (NIC) Tuning

Modern NICs have hardware offloading features that can interfere with game server traffic. Disable unnecessary offloading:

# Disable TCP segmentation offload and generic segmentation offload
ethtool -K eth0 tso off gso off gro off

# Increase the transmit queue length
ip link set dev eth0 txqueuelen 10000

# Check current settings
ethtool -k eth0

TSO (TCP Segmentation Offload) and GSO (Generic Segmentation Offload) can fragment packets in ways that game servers do not expect, causing dropped packets. Disabling them adds a small CPU cost but improves reliability.

Reducing Latency with Geographic Proximity

No amount of kernel tuning can overcome the speed of light. If your players are in Europe and your server is in Los Angeles, they will experience 150ms+ latency regardless of configuration. Choose a data center location close to your player base:

Player RegionRecommended Data CenterTypical Latency
North America EastNew York, Ashburn, Montreal5–30ms
North America WestLos Angeles, Seattle, San Jose5–30ms
Europe WestFrankfurt, Amsterdam, London5–30ms
Europe EastWarsaw, Helsinki, Bucharest10–40ms
Asia-PacificSingapore, Tokyo, Sydney5–50ms
South AmericaSão Paulo, Santiago5–40ms

Testing Network Performance

After tuning, verify your network configuration:

  • UDP throughput: iperf3 -c server_ip -u -b 100M — test UDP at 100 Mbps. Check for packet loss.
  • Latency: ping -c 100 server_ip — check for jitter. Standard deviation should be under 5ms.
  • Bufferbloat: Run the Waveform Bufferbloat Test from the server. A+ rating means no bufferbloat.
  • Real-world test: Have a player in your target region join the server and report their ping. Use the game’s built-in netgraph or net_stats console command.

Bottom Line

Network optimization for game servers is a combination of kernel tuning, firewall configuration, NIC settings, and geographic placement. The default Linux network stack is not optimized for the low-latency, high-throughput UDP traffic that game servers demand. Apply the sysctl changes above, configure your firewall to allow only necessary ports, disable NIC offloading, and choose a data center close to your players. The result is a server that feels responsive — no rubber-banding, no delayed hit registration, and no disconnects.

Find dedicated server hosting with optimized network infrastructure on our comparison page.

Leave a Reply