Andy Davies

Increasing the TCP Initial Congestion Window on Windows 2008 Server R2

In November 2010, Ben Strong highlighted how Google and Microsoft were cheating on TCP Slow-Start by setting the initial congestion window higher than the RFC value.

Since then there’s been quite a few articles discussing the performance benefits of increasing the TCP initial congestion window (initcwnd). Most of the articles showed how to make the changes on Linux but there was no coverage on whether and how it could be increased on a Windows Server.

In one of their recent posts, Tuning initcwnd for optimum performance, the guys at CDN planet mentioned they didn’t know how to change the settings on Windows either.

Having trawled through the various options in netsh, I was coming to the conclusion it wasn’t possible but Drit Suljoti of Catchpoint pointed me in the direction of MS Hotfix KB2472264 “You cannot customize some TCP configurations by using the netsh command in Windows Server 2008 R2”.

After installing this hotfix I was able to change the initial congestion window to 10 (it can be adjusted up to 16 * MSS).

Installing and configuring

  1. Request the Hotfix via http://support.microsoft.com/kb/2472264

  2. Download and install the relevant version - it’s available in x32, x64 and ia64 flavours

  3. Check the hotfix is installed ok

Type:

1
c:\netsh interface tcp show supplemental

and you should see:

1
2
3
4
5
6
7
The TCP global default template is internet

TCP Supplemental Parameters
----------------------------------------------
Minimum RTO (msec)                  : 300
Initial Congestion Window (MSS)     : 2
Delayed Ack Timeout (msec)          : 200

If you get the following then the hotfix hasn’t been installed:

1
The following command was not found: interface tcp show supplemental.
  1. Update the initial congestion window settings and switch to the custom template

First set the initial congestion window in the custom template:

1
c:\netsh interface tcp set supplemental template=custom icw=10

Then tell Windows to use the custom template instead of the standard internet one:

1
c:\netsh interface tcp set supplemental template=custom
  1. Your server should now be running with the new initcwnd value, so pull out your favourite packet sniffer - Wireshark, tcpdump etc., and test.

Performance

So far I’ve only tested this configuration on an EC2 instance and haven’t deployed it in live production environment yet.

Cursory performance tests show a great improvement downloading the default welcome.png that comes with IIS 7.5 - from 11.7s to 2.5s with a server in Singapore and a client in the UK.

I’m not sure I quite believe the 11.7s time so over the next week I’ll try some more tests with various size files and post the results.

Before (icw=2):

1
2
3
4
5
6
7
8
$ time curl ec2-175-41-175-250.ap-southeast-1.compute.amazonaws.com/welcome.png > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  180k  100  180k    0     0  15912      0  0:00:11  0:00:11 --:--:-- 20785

real    0m11.706s
user    0m0.008s
sys     0m0.015s

After (icw=10):

1
2
3
4
5
6
7
8
$ time curl ec2-175-41-175-250.ap-southeast-1.compute.amazonaws.com/welcome.png > /dev/null
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  180k  100  180k    0     0  75765      0  0:00:02  0:00:02 --:--:-- 93690

real    0m2.532s
user    0m0.007s
sys     0m0.015s

Final Notes

If you’re thinking of deploying the fix to a production server it’s probably worth reading the proposal submitted to the IETF on increasing the default value to 10 as it covers both the advantages and potential drawbacks with an increased default.

Jim Gettys also points out some of the potential issues particularly in relation to the possible effects on network equipment.

Comments