今天机器的日志有下面的报错:
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:19 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:20 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:20 web1 kernel: TCP: time wait bucket table overflow
Oct 22 15:22:20 web1 kernel: TCP: time wait bucket table overflow
解决方法:
添加在 /etc/sysctl.conf 添加如下记录:
net.ipv4.tcp_max_tw_buckets = 20000
然后执行 sysctl -p
通过执行 sysctl -a | grep tcp_max_tw_buckets 验证修改是否起效。