StupidBeauty
Read times:1236Posted at:Tue Nov 15 19:23:12 2011

转载:主题:Too many open files 问题的解决

程序中出现“Too many open files”是由于整个操作系统中所打开的文件数达到咯内核设置的上限。这個上限可使用“ulimit -n 個数上限”来修改。

http://www.iteye.com/topic/240389

亮点:

如果检查程序没有问题,那就有可能是linux默认的open files值太小,不能满足当前程序默认值的要求,比如数据库连接池的个数,tomcat请求连接的个数等。。。

查看当前系统open files的默认值,可执行:

Java代码

  1. 1.[root@pororo script]# ulimit -a

  2. 2.core file size (blocks, -c) 0

  3. 3.data seg size (kbytes, -d) unlimited

  4. 4.scheduling priority (-e) 0

  5. 5.file size (blocks, -f) unlimited

  6. 6.pending signals (-i) 128161

  7. 7.max locked memory (kbytes, -l) 32

  8. 8.max memory size (kbytes, -m) unlimited

  9. 9.open files (-n) 800000

  10. 10.pipe size (512 bytes, -p) 8

  11. 11.POSIX message queues (bytes, -q) 819200

  12. 12.real-time priority (-r) 0

  13. 13.stack size (kbytes, -s) 10240

  14. 14.cpu time (seconds, -t) unlimited

  15. 15.max user processes (-u) 128161

  16. 16.virtual memory (kbytes, -v) unlimited

  17. 17.file locks (-x) unlimited

转载:主题:Too many open files 问题的解决

程序中出现“Too many open files”是由于整个操作系统中所打开的文件数达到咯内核设置的上限。这個上限可使用“ulimit -n 個数上限”来修改。

http://www.iteye.com/topic/240389

亮点:

如果检查程序没有问题,那就有可能是linux默认的open files值太小,不能满足当前程序默认值的要求,比如数据库连接池的个数,tomcat请求连接的个数等。。。

查看当前系统open files的默认值,可执行:

Java代码

  1. 1.[root@pororo script]# ulimit -a

  2. 2.core file size (blocks, -c) 0

  3. 3.data seg size (kbytes, -d) unlimited

  4. 4.scheduling priority (-e) 0

  5. 5.file size (blocks, -f) unlimited

  6. 6.pending signals (-i) 128161

  7. 7.max locked memory (kbytes, -l) 32

  8. 8.max memory size (kbytes, -m) unlimited

  9. 9.open files (-n) 800000

  10. 10.pipe size (512 bytes, -p) 8

  11. 11.POSIX message queues (bytes, -q) 819200

  12. 12.real-time priority (-r) 0

  13. 13.stack size (kbytes, -s) 10240

  14. 14.cpu time (seconds, -t) unlimited

  15. 15.max user processes (-u) 128161

  16. 16.virtual memory (kbytes, -v) unlimited

  17. 17.file locks (-x) unlimited

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands