小编Mal*_*lax的帖子

Linux中每个进程是否有最多打开的文件?

我的问题很简单,实际上已在标题中说明。我的一个应用程序向我抛出关于“打开文件太多”的错误,即使应用程序运行的用户限制高于默认值 1024(lsof -u $USER 报告 3000 个打开的文件)。

因为我无法想象为什么会发生这种情况,我猜每个进程可能有一个最大值。

任何想法都非常感谢!

编辑:一些可能有帮助的值...

root@Debian-60-squeeze-64-minimal ~ # ulimit -n
100000

root@Debian-60-squeeze-64-minimal ~ # tail -n 4 /etc/security/limits.conf 
myapp  soft nofile 100000
myapp  hard nofile 1000000
root soft nofile 100000
root hard nofile 1000000

root@Debian-60-squeeze-64-minimal ~ # lsof -n -u myapp | wc -l
2708
Run Code Online (Sandbox Code Playgroud)

linux debian max-file-descriptors

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

标签 统计

debian ×1

linux ×1

max-file-descriptors ×1