Wednesday, October 06, 2010

Tweak Linux TCP/IP

http://kaivanov.blogspot.com/2010/09/linux-tcp-tuning.html
Edit /etc/sysctl.conf

#It still loads the module but unhooks almost all of the calls into the module. net.ipv6.conf.all.disable_ipv6=1

# Allow reuse/recycling of TIME-WAIT sockets for new connections:
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
# Enable TCP timestamps: (Timestamp add 12 bytes to the TCP headers. But, good for Gigabit network)
net.ipv4.tcp_timestamps = 1
# Enable TCP Selective/Forward Acknowledgements:
net.ipv4.tcp_sack = 1
net.ipv4.tcp_fack = 1
# Enable support for large TCP windows:
net.ipv4.tcp_window_scaling = 1
# Lower FIN timeout (default: 60):
net.ipv4.tcp_fin_timeout = 15
# Wait time between isAlive interval probes (default: 75, recommended: 15-30):
net.ipv4.tcp_keepalive_intvl = 15
# Number of probes before timing out (default: 9, recommended: 5):
net.ipv4.tcp_keepalive_probes = 5
# Maximum TCP Send Window:
net.core.wmem_max = 33554432
# Maximum TCP Receive Window:
net.core.rmem_max = 33554432
# Memory reserved for TCP rcv buffers (default: 4Kb 85Kb 4Mb):
net.ipv4.tcp_rmem = 4096 87380 33554432
# Memory reserved for TCP snd buffers (default: 4Kb 16Kb 4Mb):
net.ipv4.tcp_wmem = 4096 65536 33554432
# Explicit Congestion Notification
net.ipv4.tcp_ecn=1

# Not to cache ssthresh from previous connection
net.ipv4.tcp_no_metrics_save = 1
# To increase this for 10G NICS
net.core.netdev_max_backlog = 30000
# Use TCP VEGAS. Do modprobe tcp_vegas first!
net.ipv4.tcp_congestion_control = vegas

No comments: