Linux优化

编辑如下配置文件

vim /etc/sysctl.conf

最后几行替换成

#see details in https://help.aliyun.com/knowledge_detail/41334.html

kernel.sysrq = 1

net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_max_syn_backlog = 8192
net.ipv4.tcp_synack_retries = 2

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_fin_timeout=30

net.ipv4.tcp_keepalive_time=60
net.ipv4.tcp_keepalive_probes=5
net.core.netdev_max_backlog=3000

改完后保存,并执行下面命令让配置生效

/sbin/sysctl -p
reboot
上一篇:关于设置http响应头connection的作用


下一篇:SysCtlDelay 实现延时