keepcalculator

06 Numbers and Powers

Optimize a Dedicated Game Server: Step-by-Step Guide

Card No. 06·67433 · Updated · Standard formula, shown below

This guide walks you through practical steps to improve the performance of a dedicated game server, reducing lag, lowering ping, and increasing player capacity. You’ll learn how to tune your operating system, network settings, and game server configuration for better responsiveness and stability. Before starting, ensure you have administrative access to the server, a backup of your current configuration, and a basic understanding of your game’s server files.

What You’ll Need

  • Administrative (root or sudo) access to the server
  • SSH client (like PuTTY or Terminal) for remote access
  • A text editor (nano, vim, or Notepad++)
  • Your game server’s configuration file location
  • Optional: a server monitoring tool (like htop or netdata)

Step-by-Step

  1. Update the operating system and drivers. Run your package manager’s update command (e.g., apt update && apt upgrade on Debian/Ubuntu, or yum update on CentOS). Then update network and chipset drivers if available. Outdated drivers can cause bottlenecks.
  2. Choose a lightweight operating system. If you’re setting up a new server, use a minimal installation without a GUI. A headless Linux distribution (like Ubuntu Server or Debian) uses fewer resources, leaving more CPU and RAM for the game.
  3. Optimize CPU settings. In the BIOS or via the kernel, enable CPU performance mode (disable power saving like C-States and Intel SpeedStep). On Linux, you can set the governor to performance with cpupower frequency-set -g performance. This prevents the CPU from downclocking during gameplay.
  4. Adjust network kernel parameters. Edit /etc/sysctl.conf and add these lines to reduce latency and improve throughput:
    net.core.rmem_max = 67108864
    net.core.wmem_max = 67108864
    net.ipv4.tcp_rmem = 4096 87380 33554432
    net.ipv4.tcp_wmem = 4096 65536 33554432
    net.ipv4.tcp_congestion_control = bbr
    net.core.default_qdisc = fq

    Then apply with sysctl -p. These settings increase buffer sizes and enable the BBR congestion control algorithm, which is effective for high-bandwidth, low-latency connections.

  5. Increase the maximum number of file descriptors. Game servers often handle many simultaneous connections. Edit /etc/security/limits.conf and add:
    * soft nofile 1048576
    * hard nofile 1048576

    Then restart the server or run ulimit -n 1048576 in the server session.

  6. Disable unnecessary services and background processes. Stop and disable any services not needed for the game server, such as web servers, databases, or desktop environments. Use systemctl list-units --type=service to see what’s running and systemctl disable for unused ones.
  7. Configure the game server’s tick rate and max players. In your game’s configuration file (e.g., server.cfg for Source games, server.properties for Minecraft), set the tick rate to a value that balances performance and gameplay. A tick rate of 64 or 128 is common for fast-paced games, but higher tick rates use more CPU. Also, set maxplayers to a realistic number based on your hardware—don’t overcommit.
  8. Adjust game-specific performance settings. Many games have flags like -high (sets high process priority), -threads (number of threads), or -noaff (disable CPU affinity). Refer to your game’s documentation for recommended flags. For example, in Source games, you might add -high -threads 4 to the launch options.
  9. Use a RAM disk for save files (optional). If your game writes frequently to disk (like world saves), moving those files to a tmpfs (RAM disk) can reduce I/O latency. Be careful: data will be lost on reboot unless you sync it to persistent storage periodically.
  10. Monitor and test. After changes, restart the server and monitor CPU, RAM, and network usage with tools like htop and iftop. Use a client to connect and check ping and tick rate. Note any improvements or regressions.

Common Mistakes

  • Overclocking without proper cooling. This can cause instability and crashes. Stick to stock settings or ensure adequate cooling if you do overclock.
  • Setting tick rate too high for your hardware. A 128-tick server requires roughly double the CPU of a 64-tick server. If your CPU usage is above 80%, lower the tick rate.
  • Ignoring power management. Leaving CPU governors on “powersave” will cause performance drops. Always set to “performance” for a game server.
  • Not disabling IPv6. If your network doesn’t support IPv6 properly, it can cause delays. Disable it in sysctl with net.ipv6.conf.all.disable_ipv6 = 1 if you’re sure you don’t need it.
  • Using a shared hosting plan. Dedicated hardware is essential for consistent performance. Shared hosting often has noisy neighbors that affect your server.

Tips

  • Use a solid-state drive (SSD). SSDs drastically reduce load times and world chunk loading compared to HDDs.
  • Prioritize network quality. A server with a 1 Gbps unmetered connection and low latency to your player base is better than a higher-spec machine on a congested network.
  • Regularly restart the server. Memory leaks and fragmentation can build up over time. Schedule a nightly restart if possible.
  • Keep backups. Before making changes, back up your configuration files and world data. This allows you to revert if something goes wrong.
  • Test with multiple clients. Use different locations and network conditions to get a realistic picture of performance.

Troubleshooting

Server crashes after changing sysctl settings. Revert the changes by restoring the original sysctl.conf and reboot. Some settings may be incompatible with your kernel version.

High ping but low CPU usage. This often indicates a network issue. Check your bandwidth with a speed test, and verify that your hosting provider isn’t throttling. Also check for packet loss with ping -f from a client.

Players experience rubber-banding. This can be due to a low tick rate or insufficient bandwidth. Increase the tick rate if CPU allows, or reduce the number of players.

Server uses 100% CPU. Identify the process with top. If it’s the game server, consider lowering tick rate or max players. If it’s a background process, disable it.

Changes don’t take effect. Ensure you’ve restarted the game server and, for kernel changes, run sysctl -p or reboot. Some settings require a reboot to apply.

Frequently Asked Questions

What is a good tick rate for a game server?

For casual play, 64 tick is fine. For competitive or fast-paced games, 128 tick is preferred. Higher tick rates require more CPU and bandwidth.

Does more RAM always improve server performance?

Not necessarily. Once you have enough RAM to hold the game world and OS, additional RAM won’t help. Aim for at least 4GB for small servers, 8-16GB for larger ones.

Can I run a game server on a virtual private server (VPS)?

Yes, but performance depends on the VPS provider’s CPU allocation. A dedicated CPU VPS is better than shared CPU. Avoid overselling providers.

How do I check my server’s current tick rate?

In many games, you can use the console command net_stats (Source) or tps (Minecraft). Alternatively, use a client mod or plugin.

Is it better to use Linux or Windows for a game server?

Linux is generally preferred due to lower overhead, better stability, and no licensing costs. However, some game servers are easier to set up on Windows. Choose based on your familiarity and the game’s support.

What is the most important hardware component for a game server?

CPU is the most critical, especially for games with complex physics or many players. A high single-thread performance is often more important than multiple cores.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →