我的问题很简单,实际上是在标题中说明的。 我的一个应用程序抛出了“我打开的文件过多”的错误,即使应用程序运行的用户的限制高于默认的1024(lsof -u $ USER报告3000打开的fds)。
因为我无法想象为什么会发生这种情况,所以我估计每个进程可能会有一个最大值。
任何想法是非常感激!
编辑:一些值可能有帮助…
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
是的, ulimit工具限制了打开文件的数量以及堆栈大小,核心转储大小等许多其他内容。
您可以在/proc/<pid>/limitsfindpid进程的/proc/<pid>/limits并有一个Max open files的条目。