http://blog.chinaunix.net/space.php?uid=21505614&do=blog&id=2193881
net.ipv4.tcp_fin_timeout = 30net.ipv4.tcp_keepalive_time = 1200net.ipv4.route.gc_timeout = 100net.ipv4.ip_local_port_range = 1024 65000net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_syn_retries = 1net.ipv4.tcp_synack_retries = 1net.ipv4.tcp_max_syn_backlog = 262144net.core.netdev_max_backlog = 262144net.core.somaxconn = 262144net.ipv4.tcp_mem = 94500000 915000000 927000000
1netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
2 cat /proc/net/sockstat
netstat -an | grep 80 | awk '{print $5}' | awk 'BEGIN {FS=":"} NF==2 {print $1}NF==5{print $4}' | sort | uniq -c | sort -n
net.ipv4.tcp_fin_timeout = 60net.ipv4.tcp_keepalive_time = 7200net.ipv4.route.gc_timeout = 300net.ipv4.ip_local_port_range = 32768 61000net.ipv4.tcp_tw_reuse = 0net.ipv4.tcp_tw_recycle = 0net.ipv4.tcp_syn_retries = 5net.ipv4.tcp_synack_retries = 5net.ipv4.tcp_max_syn_backlog = 1024net.core.netdev_max_backlog = 1000net.core.somaxconn = 128net.ipv4.tcp_mem = 853440 1137920 1706880