参考:https://zhuanlan.zhihu.com/p/374135294
net.ipv4.tcp_syncookies=1
net.ipv4.tcp_tw_timeout=5 #阿里云linux才支持此参数,参考:修改TCP TIME-WAIT超时时间 - 云服务器 ECS - 阿里云https://help.aliyun.com/document_detail/155470.html
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1 #linux新版内核已经废弃,参考:Troubleshooting sysctl: cannot stat /proc/sys/net/ipv4/tcp_tw_recycle: No such file or directory
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_max_tw_buckets = 18000
编辑:/etc/sysctl.conf;
生效:sysctl -p