I've been running Game-servers on some OpenVZ systems before where the company had actually pre-set all the values for the kernel or network parameters. In an OpenVZ system, we cannot edit the "sysctl.conf" file as it comes from the host kernel. It worked pretty well and I could download/upload at full speeds on the server and my game-servers, running on the same server, wouldn't show any signs of lag.
I recently moved to a XEN system where I had to define all these parameters myself. The first issue was that when there was high traffic at game-servers, it started showing some signs of lag at servers. Using the following values in sysctl.conf helped me fix the issue and the servers didn't lag on high traffic anymore:
net.ipv4.udp_mem= 1138080 1517440 12582912 net.ipv4.tcp_mem= 1138080 1517440 12582912 net.core.wmem_max=12582912 net.core.rmem_max=12582912 net.ipv4.tcp_wmem=10240 87380 12582912 net.ipv4.tcp_rmem=10240 87380 12582912 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_no_metrics_save = 1 net.core.netdev_max_backlog = 5000
The issue now is that I feel a bit of lag on game-servers when downloading/uploading from the server. I didn't know how the company handled it on OpenVZ systems before but maybe they had set a parameter value in sysctl.conf which kept a reserved bandwidth on the system in case. The XEN server I use now, runs a 100mbps dedicated connection while the previous OpenVZ system ran a shared 1Gbps. Maybe increasing those values even more might help or adding something else?
I have a total 9.6Ghz and hardly use 500Mhz so it doesn't matter if more CPU or memory is used but what I need is higher performance. I sometimes get DDos attacks as well so some performance tuning that will make those attacks lease affective might help too.
I wonder if these commands below help:
# Disables IP source routing net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.lo.accept_source_route = 0 net.ipv4.conf.eth0.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 # Enable IP spoofing protection, turn on source route verification net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.lo.rp_filter = 1 net.ipv4.conf.eth0.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 # Disable ICMP Redirect Acceptance net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.lo.accept_redirects = 0 net.ipv4.conf.eth0.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 # Set maximum amount of memory allocated to shm to 256MB kernel.shmmax = 268435456 # Improve file system performance vm.bdflush = 100 1200 128 512 15 5000 500 1884 2 # Improve virtual memory performance vm.buffermem = 90 10 60 # Increases the size of the socket queue (effectively, q0). net.ipv4.tcp_max_syn_backlog = 1024