Lenmore Blog -- 我的记事本、备忘录

高并发Linux Web服务器TCP优化参数

written on Monday, June 2, 2008

修改/etc/sysctl.conf, /sbin/sysctl -p立即生效

永久修改内核参数: echo "10" > /proc/sys/net/ipv4/tcp_fin_timeout

各种参数的意思:http://ipsysctl-tutorial.frozentux.net/ipsysctl-tutorial.html

还参考了:http://trac.lighttpd.net/trac/wiki/Docs%3APerformance#platform-specific-notes

net.ipv4.tcp_fin_timeout = 10
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
#tcp port range
net.ipv4.ip_local_port_range = 4096 65000
#tcp send buffer. min, default , and max
net.ipv4.tcp_wmem = 4096 65536 16777216
#tcp reservie buffer.
#net.ipv4.tcp_rmem = 4096 65536 16777216

This entry was tagged linux