|
发表于 2009-6-5 09:30:11
|
显示全部楼层
其实too many open files问题还是经常会遇到的,尤其是和Java相关。不仅仅是Oracle DB,还有Application Server,比如WebLogic Server安装配置过程中也会有这个问题。
ulimit的方法只是session wide的解决方法。
永久的解决方法也有很多,
sysctl -w fs.file-max 65536
或者
echo "65536" /proc/sys/fs/file-max (直接作用在pseudo file system上对应的文件)
以下是我自己研究和其他guru讨论之后的结论,写在自己的blog上了,如果有什么问题,请指出,我会更正。
http://terrywang.net/archives/549
基本上优先级:
soft limit < hard limit < kernel < 实现最大file descriptor数采用的数据结构所导致的限制
The Linux kernel provides the getrlimit and setrlimit system calls to get and set resource limits per process. Each resource has an associated soft and hard limit. The soft limit is the value that the kernel enforces for the corresponding resource. The hard limit acts as a ceiling for the soft limit: an unprivileged process may only set its soft limit to a value in the range from 0 up to the hard limit, and (irreversibly) lower its hard limit. A privileged process (one with the CAP_SYS_RESOURCE capability) may make arbitrary changes to either limit value. |
|