手机版 收藏 导航

CentOS 7 如何优化内核参数

原创   www.link114.cn   2023-07-14 14:18:32

CentOS 7 如何优化内核参数

编辑/etc/security/limits.conf文件,增加以下内容:

* soft nofile 65535
* hard nofile 65535

编辑/etc/sysctl.conf文件,添加以下内容:

net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.ip_local_port_range = 1024 65535
net.core.somaxconn = 262144
net.core.rmem_default = 8388608
net.core.wmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

编辑/sys/block/sda/queue/scheduler文件,修改为deadlinenoop调度算法.

编辑/etc/sysctl.conf文件,添加以下内容:

kernel.pid_max = 4194303
kernel.threads-max = 64536