首页 > 代码库 > 优化脚本
优化脚本
第一步
vim /etc/sysctl.conf net.ipv4.tcp_keepalive_time =1800 net.ipv4.tcp_keepalive_probes =5 net.ipv4.tcp_keepalive_intvl =15 net.core.rmem_max =167772160 net.core.wmem_max =167772160 net.ipv4.tcp_rmem =4096 87380 167772160 net.ipv4.tcp_wmem =4096 65536 167772160 net.ipv4.tcp_fin_timeout = 30 net.ipv4.tcp_tw_recycle = 1 net.ipv4.tcp_tw_reuse = 0 net.core.netdev_max_backlog = 30000 net.ipv4.tcp_no_metrics_save =1 net.core.somaxconn = 2621440 #net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_max_orphans = 2621440 net.ipv4.tcp_max_syn_backlog = 2621440 net.ipv4.tcp_synack_retries = 2 net.ipv4.tcp_syn_retries = 2 net.ipv4.ip_conntrack_max = 6553600 net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 180 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_max_tw_buckets = 20000 net.ipv4.ip_local_port_range = 1024 65535 net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 120 net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait = 60 net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait = 120 net.ipv4.neigh.default.gc_thresh1 = 10240 net.ipv4.neigh.default.gc_thresh2 = 40960 net.ipv4.neigh.default.gc_thresh3 = 81920 vm.dirty_ratio = 10
第二步
ulimit
/sbin/sysctl -p
第三步
ulimit -n 65536
第四步
vim /etc/security/limits.conf 增加 * soft nofile 65536 * hard nofile 65536
本文出自 “绿茶布丁” 博客,请务必保留此出处http://pudding.blog.51cto.com/8909132/1411493
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。