CentOS 6.4 update finally supports IW10 for tcp/ip tuning
Google and others have published several whitepapers showing benchmarks where tuning tcp/ip on servers can really help web browsing performance.
One of these important tweaks is known as IW10 which improves the tcp/ip congestion window by reducing ACKs (initally sending 10 packets instead of only 3) and is enabled by increasing initcwnd and initrwnd.
Unfortunately those on CentOS (one of the most popular linux production distributions) were not able to take advantage of this – until this weekend when CentOS 6.4 was shipped.
CentOS 6.3 could change initcwnd but NOT initrwnd (RWIN) which requires a kernel > 2.6.33
CentOS 6.4 is 2.6.32-358.0.1.el6 (Red Hat 4.4.7-3) so the feature has been backported
Here’s how to take advantage of IW10 on CentOS 6.4
This is obviously for power users with root access to their VPS or dedicated servers (this will NOT work on Virtuozzo VZ vps!)
First of course do a yum update to get Centos 6.4
Then take a look at your current settings via
ip route show
You are looking for the last line that will say something like
default via 126.96.36.199 dev eth0
Then just take that line and add two parts to it
ip route change default via 188.8.131.52 dev eth0 initcwnd 10 initrwnd 10
And bingo, you now have IW10 support.
If something goes wrong, it will just complain and not make the change.
Note these changes aren’t permanent, you will have to add the line to /etc/rc.local
or similar, to make it happen on each reboot
There are other important things to tune with tcp/ip, but one of the other most important is to disable “slow start after idle”
sysctl -a | grep tcp_slow_start_after_idle
sysctl -w net.ipv4.tcp_slow_start_after_idle=0
It is possible to actually examine the performance improvements of making this change on a packet level but it requires the use of wireshark and and counting ACKs which is a bit tedious so I will skip that for now.
Unfortunately it might be YEARS before CentOS gets things like TCP Fast Open which has only appeared a few months ago in linux kernel > 3.5 but I am still investigating if it’s possible in CentOS 6.4 to easily reduce the RTT initial timeout from 3 seconds to 1 second which is another recommended tcpip tuning improvement.