Initial Server Hardening
Before hosting game servers, secure your VPS. Update all packages with 'apt update && apt upgrade' (Debian/Ubuntu) or 'dnf update' (CentOS/Rocky). Create a non-root user with sudo privileges — never run game servers as root. Configure a firewall with UFW: allow only SSH (port 22) and the ports your game servers need. Install fail2ban to block brute-force SSH attempts.
Optimizing Network Settings
Edit /etc/sysctl.conf to tune TCP performance for game traffic. Add: net.core.rmem_max=134217728, net.core.wmem_max=134217728, net.ipv4.tcp_rmem='4096 87380 134217728', net.ipv4.tcp_wmem='4096 65536 134217728'. Apply with 'sysctl -p'. These settings increase buffer sizes for handling burst game traffic. Also enable TCP BBR congestion control for better throughput on high-latency connections.
CPU Governor and Performance Mode
Game servers benefit from consistent CPU clock speeds. Set the CPU governor to performance mode: 'echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor'. This prevents the CPU from downclocking during low load periods. On our KVM VPS plans, CPU cores are dedicated, so setting the performance governor provides immediate latency improvements for tick-based game servers like CS2 and Rust.
RAM and Swap Configuration
Allocate enough RAM for your game servers plus 2 GB for the operating system. For a Minecraft server with 6 GB allocated, your VPS should have at least 8 GB total RAM. Configure swap space equal to your RAM size as a safety buffer: 'fallocate -l 8G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile'. Add it to /etc/fstab for persistence across reboots.
Scheduled Maintenance with Cron
Automate server restarts during off-peak hours using cron jobs. Example: '0 4 * * * /home/user/minecraft/restart.sh' restarts your Minecraft server daily at 4 AM. Create a restart script that gracefully stops the server (sends save command, waits 30 seconds), updates plugins if needed, and starts again. Always test your restart scripts manually before scheduling them.
Monitoring and Logging
Install htop for real-time resource monitoring. Set up automated log rotation to prevent disk space issues: create a logrotate config that compresses logs older than 7 days and deletes them after 30 days. Use a tool like netdata or Grafana + Prometheus for detailed metrics dashboard. Monitor disk IO wait — if it exceeds 5%, you may need to upgrade to NVMe storage or optimize database queries.
FAQ
Related Tutorials
Was this guide helpful?
Join our Discord for more guides and direct help from our engineering team.
