原因:
Mac文件系统允许最大打开的文件数有限制
You can check these with:
sysctl kern.maxfiles
sysctl kern.maxfilesperproc
You can increase the limits (at your own risk) with:
sysctl -w kern.maxfiles=20480 (or whatever number you choose)
sysctl -w kern.maxfilesperproc=18000 (or whatever number you choose)
修改:
新建/etc/sysctl.conf文件
添加:
kern.maxfiles=20480
kern.maxfilesperproc=18000
执行:
ulimit -S -n 2048
为了保证ulimit -S -n 2048每次都能执行到, 需要加到.bashrc文件里
Is there a fix for the “Too many open files in system” error on OS X 10.7.1?