Ubuntu – How to reduce TCP latency for gaming

gamesnetworkingperformance

I use Ubuntu for gaming. In competitive gaming every millisecond matters.

I know that many people who use Windows use something called Leatrix Latency Fix which is basically a script that modify TCPAckFrequency. This reduce the online gaming latency by increasing the frequency of TCP acknowledgements sent to the game server.

On Mac OS X you can get this effect by running
sudo sysctl -w net.inet.tcp.delayed_ack=0
.

I've heard that the Linux kernel have a very advanced IP stack and can use many different TCP congestion avoidance algorithm. I don't know if that has anything to do with TCP acknowledge frequency. I also heard that the Linux kernel auto-adjusts TCP/IP settings for optimal performance.

Is there anything I can do to reduce TCP/IP latency?

Best Answer

Well you should make sure everything else outside your computer is behaving nicely.

Run a traceroute to the gaming server. Where does latency grow? Is it normal or is it happening in places where it shouldn't?

For example, a hop from New York to London will add latency. Fifty or so milliseconds to the first hop after your router probably means faulty equipment in your last mile; doublecheck with your neighbours.

How much latency do you have to your router? Switching from wifi to wired connectivity may not always be possible, but it might just shave five or so milliseconds.

Is your computer good enough for the game? Sometimes game will have suboptimal performace under Wine, and well, if a game can't process packets in a round trip time (your latency to the game server as measured through pingor traceroute doubled) then the bottleneck is actually not the network.

Does your ping even matter? Most real time games require interpolation to run smoothly. This means you're actually playing "in the past." For example, Source games have every player running 0.1 seconds in the past, which means all players with latency in the double digits actually are playing on a even field. Personally I play at 160 ping on TF2 servers in US and don't really have too much trouble with it. Read more here. Read here about the Unreal networking stack.

Related Question