检查连接状态
ss -s
netstat -an | awk '{print $6}' | sort | uniq -c | sort -rn
ss -tan | grep TIME-WAIT | wc -l
优化参数(/etc/sysctl.conf)
net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_tw_reuse = 1 net.ipv4.ip_local_port_range = 1024 65000 net.core.somaxconn = 1024 net.ipv4.tcp_max_syn_backlog = 1024 sysctl -p # 立即生效
查看文件描述符限制
ulimit -n cat /etc/security/limits.conf | grep nofile