系统优化参数总结:net.ipv4.tcp_syncookies = 1 表示开启SYN Cookies。当出现SYN等待队列溢出时,启用cookies来处理,可防范少量SYN攻击net.ipv4.tcp_tw_reuse = 1 表示开启重用。允许将TIME-WAIT sockets重新用于新的TCP连接net.ipv4.tcp_tw_recycle = 1 表示开启TCP连接中TIME-WAIT sockets的快速回收 关闭 tcp_tw_reccycle 的时候,kernal 是不会检查对端机器的包的时间戳的 在多nat模式下,需要关闭该参数,不然会导致用户无法连接或者连接超时net.ipv4.tcp_fin_timeout = 30 表示如果套接字由本端要求关闭,这个参数决定了它保持在FIN-WAIT-2状态的时间net.core.rmem_default = 8388608net.core.rmem_max = 16777216net.core.wmem_default = 8388608net.core.wmem_max = 16777216net.ipv4.tcp_timestamps = 1vm.overcommit_memory = 1net.ipv4.tcp_keepalive_time = 120net.ipv4.tcp_fin_timeout = 30net.ipv4.tcp_max_syn_backlog = 6553500net.core.somaxconn = 32768net.core.netdev_max_backlog = 262144net.ipv4.tcp_syn_retries = 2net.ipv4.tcp_synack_retries = 1net.ipv4.tcp_keepalive_probes = 5net.ipv4.tcp_keepalive_intvl = 30net.ipv4.ip_local_port_range = 1024 65535net.ipv4.ip_forward = 1 开启nat转发net.ipv4.tcp_max_tw_buckets = 280000net.netfilter.nf_conntrack_max = 65535000net.netfilter.nf_conntrack_tcp_timeout_established = 1200