码迷,mamicode.com
首页 > 其他好文 > 详细

优化脚本

时间:2014-05-15 12:32:43      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:优化   脚本   sysctl   ulimit   

第一步

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

优化脚本,布布扣,bubuko.com

优化脚本

标签:优化   脚本   sysctl   ulimit   

原文地址:http://pudding.blog.51cto.com/8909132/1411493

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!