limits是linux限制的统称.
在linux早期,limits一般都是限制在1024,例如打开文件数量,连接数等等
到了现在, 服务器性能大幅提高,这些限制就有些落伍了.
我们需要手动修改, 以提高服务器的利用率
下面是我收集的几个修改limits配置的路径
1. 修改 /etc/sysctl.conf 添加 fs.file-max = 65535
2. 修改 /etc/profile
ulimit -n 65535 ulimit -Sn 65535 ulimit -Hn 65535
3. 修改 /etc/security/limits.conf
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535
4 修改 /etc/security/limits.conf
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535
5 修改 /etc/security/limits.d/90-nproc.conf
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535
6 使用 systemd 服务的在配置里改[适用于centos7 debian系]
#systemctl edit rc-local.service [Service] LimitNOFILE=65535
此处评论已关闭