程序中出现“Too many open files”是由于整个操作系统中所打开的文件数达到咯内核设置的上限。这個上限可使用“ulimit -n 個数上限”来修改。
http://www.iteye.com/topic/240389
亮点:
如果检查程序没有问题,那就有可能是linux默认的open files值太小,不能满足当前程序默认值的要求,比如数据库连接池的个数,tomcat请求连接的个数等。。。
查看当前系统open files的默认值,可执行:
Java代码
1.[root@pororo script]# ulimit -a
2.core file size (blocks, -c) 0
3.data seg size (kbytes, -d) unlimited
4.scheduling priority (-e) 0
5.file size (blocks, -f) unlimited
6.pending signals (-i) 128161
7.max locked memory (kbytes, -l) 32
8.max memory size (kbytes, -m) unlimited
9.open files (-n) 800000
10.pipe size (512 bytes, -p) 8
11.POSIX message queues (bytes, -q) 819200
12.real-time priority (-r) 0
13.stack size (kbytes, -s) 10240
14.cpu time (seconds, -t) unlimited
15.max user processes (-u) 128161
16.virtual memory (kbytes, -v) unlimited
17.file locks (-x) unlimited
程序中出现“Too many open files”是由于整个操作系统中所打开的文件数达到咯内核设置的上限。这個上限可使用“ulimit -n 個数上限”来修改。
http://www.iteye.com/topic/240389
亮点:
如果检查程序没有问题,那就有可能是linux默认的open files值太小,不能满足当前程序默认值的要求,比如数据库连接池的个数,tomcat请求连接的个数等。。。
查看当前系统open files的默认值,可执行:
Java代码
1.[root@pororo script]# ulimit -a
2.core file size (blocks, -c) 0
3.data seg size (kbytes, -d) unlimited
4.scheduling priority (-e) 0
5.file size (blocks, -f) unlimited
6.pending signals (-i) 128161
7.max locked memory (kbytes, -l) 32
8.max memory size (kbytes, -m) unlimited
9.open files (-n) 800000
10.pipe size (512 bytes, -p) 8
11.POSIX message queues (bytes, -q) 819200
12.real-time priority (-r) 0
13.stack size (kbytes, -s) 10240
14.cpu time (seconds, -t) unlimited
15.max user processes (-u) 128161
16.virtual memory (kbytes, -v) unlimited
17.file locks (-x) unlimited
HxLauncher: Launch Android applications by voice commands