centos7.3修改内核参数

  |   0 评论   |   116 浏览

  1. 修改内核参数
cat << EOF >/etc/sysctl.conf
net.ipv4.ip_local_port_range = 1024 65535
kernel.shmall = 4294967296
net.ipv4.tcp_fin_timeout=10
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_keepalive_time = 3
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_keepalive_probes = 2
net.ipv4.tcp_keepalive_intvl = 1
fs.file-max = 6553560
EOF

2. 配置limits.conf

cat << EOF >/etc/security/limits.conf
* soft noproc 65536
* hard noproc 65536
* soft nofile 65536
* hard nofile 65536
EOF

重新登录后执行ulimit -a检查配置是否生效


标题:centos7.3修改内核参数
作者:SmiteLi
地址:https://smite.site/articles/2019/09/24/1569309048141.html

评论

发表评论