- Failed to set posix_spawn_file_a
- 2020-03-25 CentOS Failed to set
- this class is not key value codi
- this class is not key value cod
- Docker Desktop 打开失败
- MongoDB:处理 Failed to set up list
- Failed to set remote answer sdp:
- Failed to set locale, defaulting
- Linux 提示Failed to set locale, de
- docker搭建的mongo运行Permission denie
如何解决错误:Failed to set posix_spawn_file_actions for fd -1 at index 1 with errno 9
-
批量读写文件的时候有机会会出现这个系统报错,这是打开文件句柄数过多,超过文件系统最大可打开文件的原因。
-
这句指令可以查看系统允许的最多文件句柄数目:
╭─mao@BatmanMac.local /etc ‹ruby-2.7.0›
╰─➤ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 709
-n: file descriptors 256 // 可以看到这里默认一般是
- 不过我们可以通过
ulimit -n 9000
指令来修改为:
╭─jianzhimao@BatmanMac.local /etc ‹ruby-2.7.0›
╰─➤ ulimit -n 9000
╭─jianzhimao@BatmanMac.local /etc ‹ruby-2.7.0›
╰─➤ ulimit -a
-t: cpu time (seconds) unlimited
-f: file size (blocks) unlimited
-d: data seg size (kbytes) unlimited
-s: stack size (kbytes) 8192
-c: core file size (blocks) 0
-v: address space (kbytes) unlimited
-l: locked-in-memory size (kbytes) unlimited
-u: processes 709
-n: file descriptors 9000 // 可以看到这里已经改为9000啦,经测试好像最多只能改到1万
网友评论