# TCP Slow Start in Network Games

I'm getting latency issues in bandwidth intensive level transitions part of my game that are proportional to the distance to the server. I believe I'm hitting TCP Slow Start issues. It's also fine when I spam level transitions in quick succession but the problems re-appears. Note that I'm not breaking the TCP connection.

Effectively the transfer rate of my game is very bursty and remote users are experiencing a high latency (0.8 second) during these events. Some of the data I need to send during these bursts are dynamic so I can't pre-exchange it.

Is there anything I can do to mitigate the problem? Sending dummy data to keep the TCP window size is pretty much not a solution.

All the data needs to be received in-order so UDP isn't really appropriate here.

• What kind of data is this? – Steven May 9 '16 at 0:07
• Disabled Nagle? (Windows) – Stormwind May 9 '16 at 23:31

Cache the non dynamic stuff perhaps or use other mechanisms for the "burst" situation its hard to say without knowing more about the data.

Profiling the traffic may tell more about the behvaiour of the request lifecycle, if an event is coming up can your client start streaming before the event is actually triggered?

I tend to have a large buffer throughout and keep it fairly large just in case this situation arises, I use more ram on both ends but the system expects it

...

Lots of guessing here

Turns out I needed to set tcp_slow_start_after_idle:

/sbin/sysctl -w net.ipv4.tcp_slow_start_after_idle=0


Looks like SPDY suggests the same for similar reasons.

• Isn't that a system-wide network change? – Cypher May 11 '16 at 15:46
• @Cypher, yeah it is. I really don't think this is an acceptable general solution: 1. you have to be root to change kernel parameters, 2. who wants to change their kernel params for a game's bad network code, 3. not every OS has sysctl or a *nix kernel. – user5665 May 11 '16 at 17:32