有些国外机器默认不会调整系统参数,导致在上面跑的应用经常性出现异常
主要针对两个参数 内核参数和系统限制
内核参数级别

vm.swappiness = 0
kernel.sysrq = 1
net.ipv4.neigh.default.gc_stale_time = 120
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce = 2
net.ipv4.conf.all.arp_announce = 2
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2
net.ipv6.conf.lo.disable_ipv6 = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1

系统打开文件数和用户线程打开数调整

root soft nofile 65535
root hard nofile 65535
* soft nofile 65535
* hard nofile 65535

如果有时间我再写个一键优化脚本,到时候看看逻辑吧!通用的逻辑没什么 主要针对判断!


版权声明:本文为原创文章,版权归 Wait li 的运维笔记 所有,转载请联系博主获得授权!
本文地址:http://waitli.top/index.php/archives/35/

评论已关闭

×