我正在使用CentOS 7.我发现使用$ ulimit -a (查找打开的文件)可以看到当前值。
或者只是$ ulimit -n
然后我尝试通过编辑文件来编辑这些限制
$ vim /etc/security/limits.conf
并添加这两行:
soft nofile 999999 hard nofile 999999
快速重启之后,检查是否发生了一些事情
$ ulimit -n
它仍然是一样的,我得到1024作为输出。
如何改变这个值并使其在重新启动后保持不变?
开始时需要用户部分,而错误的方式应该是:
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535