Ubuntu Server – Increase TCP Performance

To greatly increase your server’s TCP performance, you can enable the use of Syn Cookies, increase the buffer size, and enable TCP window scaling. Creds go to this site. Edit the “etc/sysctl.conf” file and enter the following:

# Use TCP syncookies when needed
net.ipv4.tcp_syncookies = 1
# Enable TCP window scaling
net.ipv4.tcp_window_scaling = 1
# Increase TCP max buffer size
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
# Increase Linux autotuning TCP buffer limits
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
# Increase number of ports available
net.ipv4.ip_local_port_range = 1024 65000

Then you can check to make sure it’s active by typing:

sudo sysctl -p

Leave a Reply