too many open files
来源:互联网 发布:2016赛季库里数据 编辑:程序博客网 时间:2024/06/05 04:22
查看每个用户最大允许打开文件数量
ulimit -a
- fdipzone@ubuntu:~$ ulimit -a
- core file size (blocks, -c) 0
- data seg size (kbytes, -d) unlimited
- scheduling priority (-e) 20
- file size (blocks, -f) unlimited
- pending signals (-i) 16382
- max locked memory (kbytes, -l) 64
- max memory size (kbytes, -m) unlimited
- open files (-n) 1024
- pipe size (512 bytes, -p) 8
- POSIX message queues (bytes, -q) 819200
- real-time priority (-r) 0
- stack size (kbytes, -s) 8192
- cpu time (seconds, -t) unlimited
- max user processes (-u) unlimited
- virtual memory (kbytes, -v) unlimited
- file locks (-x) unlimited
其中 open files (-n) 1024 表示每个用户最大允许打开的文件数量是1024
查看当前系统打开的文件数量
- lsof | wc -l
- watch "lsof | wc -l"
查看某一进程的打开文件数量
- lsof -p pid | wc -l
- lsof -p 1234 | wc -l
设置open files数值方法
ulimit -n 2048
- fdipzone@ubuntu:~$ ulimit -n 2048
- fdipzone@ubuntu:~$ ulimit -a
- core file size (blocks, -c) 0
- data seg size (kbytes, -d) unlimited
- scheduling priority (-e) 20
- file size (blocks, -f) unlimited
- pending signals (-i) 16382
- max locked memory (kbytes, -l) 64
- max memory size (kbytes, -m) unlimited
- open files (-n) 2048
- pipe size (512 bytes, -p) 8
- POSIX message queues (bytes, -q) 819200
- real-time priority (-r) 0
- stack size (kbytes, -s) 8192
- cpu time (seconds, -t) unlimited
- max user processes (-u) unlimited
- virtual memory (kbytes, -v) unlimited
- file locks (-x) unlimited
这样就可以把当前用户的最大允许打开文件数量设置为2048了,但这种设置方法在重启后会还原为默认值。
永久设置方法
- vim /etc/security/limits.conf
- 在最后加入
- * soft nofile 4096
- * hard nofile 4096
- fdipzone soft nofile 8192
- fdipzone hard nofile 8192
0 0
- too many open files
- too many open files
- Too many open files
- too many open files
- Too many open files
- too many files open
- too many open files
- too many open files
- Too many open files
- Open Too Many files
- Too many open files
- Too many open files
- too many open files
- Too many open files
- too many open files
- too many files open
- too many open files
- Too many open files
- 操作系统知识总结.
- 4文件上传与下载
- UML 符号说明
- Ubuntu14.04 Torch Configuration
- 【Spring 2】spring的属性注入形式
- too many open files
- 5在JSP中使用数据库
- Makefile.am, Makefile.in 与 Makefile的关系
- 说说JSON和JSONP,也许你会豁然开朗
- Windows批处理(cmd/bat)常用命令小结
- final方法不能被覆盖,可被重载(方法名相同而参数不同)
- 【HDU】5490 Simple Matrix(2015 ACM/ICPC Asia Regional Hefei Online)
- 大数据时代的技术hive:hive介绍
- eclipse c/c++点击运行时提示project file does not exist