If you have been following our
TCP Performance Tuning series, you'll know
that we want to enable RFC 1323 Window Scaling and increase the TCP window size
1 MB. To do this, we'll add the following lines to /etc/sysctl.conf
and issue
sudo sysctl -p
to apply the changes immediately.
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.rmem_default = 1048576
net.core.wmem_default = 1048576
net.ipv4.tcp_rmem = 4096 1048576 16777216
net.ipv4.tcp_wmem = 4096 1048576 16777216
net.ipv4.tcp_congestion_control = bic
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
As before, we're setting the maximum buffer size large and the default window
size to 1 MB. RFC 1323 is enabled via net.ipv4.tcp_window_scaling
and
net.ipv4.tcp_timestamps
. These options are probably on by default, but it never
hurts to force them via /etc/sysctl.conf
. Finally, we are choosing BIC as our
TCP Congestion Control Algorithm.
Again, that value is most likely the default on your system (especially any kernel
version after 2.6.12).