首页 > 系统服务 > 详细

linux优化

时间:2019-04-08 21:34:35      阅读:187      评论:0      收藏:0      [点我收藏+]
 1 #!/bin/bash
 2 echo "* soft nofile 1048576" >> /etc/security/limits.conf
 3 echo "* hard nofile 1048576" >>  /etc/security/limits.conf
 4 
 5 echo "fs.file-max = 1048576" >> /etc/sysctl.conf
 6 
 7 echo "net.ipv4.ip_local_port_range = 1024 65535" >> /etc/sysctl.conf
 8 echo "net.ipv4.tcp_mem = 786432 2097152 3145728" >> /etc/sysctl.conf
 9 echo "net.ipv4.tcp_rmem = 4096 4096 16777216" >> /etc/sysctl.conf
10 echo "net.ipv4.tcp_wmem = 4096 4096 16777216" >> /etc/sysctl.conf
11 
12 echo "net.ipv4.tcp_tw_recycle = 1" >> /etc/sysctl.conf
13 echo "net.core.somaxconn = 262144" >> /etc/sysctl.conf
14 echo "net.ipv4.tcp_max_syn_backlog = 8192" >> /etc/sysctl.conf
15 echo "net.core.netdev_max_backlog = 65536" >> /etc/sysctl.conf
16 
17 echo "net.ipv4.tcp_keepalive_time = 1800" >> /etc/sysctl.conf
18 echo "net.ipv4.tcp_keepalive_probes = 3" >> /etc/sysctl.conf
19 echo "net.ipv4.tcp_keepalive_intvl = 15" >> /etc/sysctl.conf
20 
21 sysctl -p

 

linux优化

原文:https://www.cnblogs.com/mliu/p/10673316.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!