星期三, 1月 13, 2010

[Linux] About "kernel: TCP: time wait bucket table overflow"

tcp_max_tw_buckets

Maximal number of timewait sockets held by system simultaneously. If this number is exceeded TIME_WAIT socket is immediately destroyed and warning is printed. This limit exists only to prevent simple DoS attacks, you must not lower the limit artificially, but rather increase it (probably, after increasing installed memory), if network conditions require more than default value (180000).

所以當你設小的時候呢,/var/log/messages就會出現一堆"kernel: TCP: time wait bucket table overflow",所以default值千萬別亂改,如果你的程式會有狠大的traffic

怎麼改回來呢?
在/etc/sysctl.conf加這行
net.ipv4.tcp_max_tw_buckets = 180000

還要
echo 180000 > /proc/sys/net/ipv4/tcp_max_tw_buckets

沒有留言:

張貼留言