Processes have limits on open file descriptors
Working on a NodeJS project recently, I learned a new fact from an error message:
Error: EMFILE, too many open files
Processes are limited in the number of file descriptors they can open. This limit seems entirely reasonable, but I'd never bumped into it until this debugging session.
On OSX, there are several points for configuring maxima. The relevant one to change depends on the problem. Roughly, configuration exists at three levels:
- Shell and processes it creates
- Processes managed by launchd
This StackExchange answer summarizes the levels and corresponding commands. Some commands (like ulimit) work on other Unix-y systems.
On OSX, to see limits for the current shell and processes it creates:
Kernel limits can be seen by running: