码迷,mamicode.com
首页 > 系统相关 > 详细

linux优化

时间:2019-04-08 21:08:32      阅读:204      评论:0      收藏:0      [点我收藏+]

标签:ash   har   bin   live   dev   soft   file   nofile   probe   

 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优化

标签:ash   har   bin   live   dev   soft   file   nofile   probe   

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

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