小编sha*_*ind的帖子

nofile ulimit -n 在 Ubuntu 14.04 LTS 上

? sudo sysctl -a|grep file

fs.file-max = 2037581
fs.file-nr = 2784   0   2037581

? ~ cat /proc/sys/fs/file-max
2037581

? ~ cat /proc/sys/fs/file-nr
2720    0   2037581
Run Code Online (Sandbox Code Playgroud)

/etc/security/limits.conf

* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581
Run Code Online (Sandbox Code Playgroud)

/etc/pam.d/su

session required pam_limits.so
Run Code Online (Sandbox Code Playgroud)

/etc/pam.d/common-session

session required pam_limits.so
Run Code Online (Sandbox Code Playgroud)

然后重新启动。

但是 ulimit -n 又得到了 1024。

只能 ulimit -n 4096 作为最大值

或出错

 ulimit: value exceeds hard limit
Run Code Online (Sandbox Code Playgroud)

ulimit 14.04

6
推荐指数
2
解决办法
2万
查看次数

标签 统计

14.04 ×1

ulimit ×1