我正在尝试为 ubuntu 机器上的所有用户提高打开文件描述符的最大值。
这个问题有点像这个问题的后续。
即使需要 pam_limits.so,ulimit 也不会读取打开的文件描述符limits.conf 设置
除了我在limits.conf中添加了所需的“root”条目
这是条目
* soft nofile 100000
* hard nofile 100000
root soft nofile 100000
root hard nofile 100000
Run Code Online (Sandbox Code Playgroud)
相关的pam_limits.so行在 /etc/pam.d/ 中的所有相关文件中已取消注释,并fs.file-max已在 /etc/sysctl.conf 中正确设置
然而,我仍然看到
abc@machine-2:/etc/pam.d$ ulimit -n
1024
Run Code Online (Sandbox Code Playgroud)
重启后。
可能是什么问题呢?
我的默认 shell 是 /bin/sh 并且我不能使用 chsh 来更改我的默认 shell,因为我的机器上的用户是通过某种分布式身份验证方案进行身份验证的。
试图在高负载 Web 服务器上获得相当于 ulimit -n 20000 的值,但是 ubuntu hardy 上的 /etc/security/limits.conf 似乎并没有坚持。
这是我在配置文件中设置的。
root soft nofile 20000
root hard nofile 20000
www-data soft nofile 20000
www-data hard nofile 20000
Run Code Online (Sandbox Code Playgroud)
我也试过
* soft nofile 20000
* hard nofile 20000
Run Code Online (Sandbox Code Playgroud)
重新启动后,当我在 root、www-data 或我的普通用户上运行 ulimit -n 时,我仍然看到默认的 1024。