Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
Latency grows as follow: 0.1ms; 1.4 ms; 1.5ms; 29ms; 9ms; 11ms; 9ms; 9ms; 10ms; 43ms. – Anonymous Feb 18 '12 at 21:18
First hop is 0.1ms. Using wired connection. 100 mbit/s Ethernet. Yes, my computer is good enough for the game. Game server is on same continent, not transatlantic. Game does not run under Wine, it is a native Linux binary. Yes, in this game the ping matters, it does not use interpolation to run smoothly. – Anonymous Feb 18 '12 at 21:24
@Anonymous It is kind of weird to see the latency go up and down like that, but all of that seems more than reasonable to me. There's not much more you can shave off there in terms of latency I'm afraid. – badp Feb 18 '12 at 23:37
That is the latency of the traceroute. It wouldn't ping like that. Also, a ping would measure the round-trip delay of when the packet left my machine to when it got a reply back. However I'm not sure it does take into account that the IP stack can delay sending packets or delay acknowledging that it received a packet. – Anonymous Feb 19 '12 at 12:47
Uh. A traceroute is all about sending a number of pings with an increasingly long number of hops they're allowed to make. A traceroute "pings like that" by definition. As for those delays, the in-game amount of ping most likely is affected by the buffering the system might use. How much difference is there between the in-game latency and the in-system latency? – badp Feb 19 '12 at 16:07

My father was a big fan of TCP Doctor or some such program in Windows because he swore that his internet was sooo much faster with it. Personally, I never saw a difference. But, he did ask me how he could do it in Linux. He was so disappointed he couldn't use the program. So, I did my research. You are correct, Linux actively adjusts the TCP receive window and many other TCP aspects automagically. Unless you're having real problems, I'd leave it as it is.

However, if you feel you must tweak it here is a decent-looking reference (but keep in mind, all these files they talk about are automatically managed and adjusted by the kernel unless you modify them at run-time):

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.