Most operating systems can change the open-files limit for the current shell session using the ulimit -n command:
ulimit -n 200000
Start by checking the current open file limit values with:
launchctl limit maxfiles
The response should look something like this:
maxfiles 65536 65536
The first column is the soft limit and the last column is the hard limit.
To change the open files limits on Mac OS X El Capitan, perform the following steps:
- Add the following line to your .bash_profile or analogous file:
ulimit -n 65536 200000
- Save and close the file. Next open
/etc/sysctl.conf
(or create it if it doesn’t already exist) and add the following settings:
kern.maxfiles=200000
kern.maxfilesperproc=200000
- Restart your computer and enter ulimit -n into your terminal. If your system is configured correctly, you should see that maxfiles has been set to 200000.
Start by checking the current open file limit values with:
launchctl limit maxfiles
The response should look something like this:
maxfiles 65536 65536
The first column is the soft limit and the last column is the hard limit.
To change the open files limits on Mac OS X Yosemite, perform these steps:
- Add the following line to your
.bash_profile
or analogous file:
ulimit -n 65536 200000
- Save and close the file. Next edit the
/etc/launchd.conf
file and add:
limit maxfiles 200000
-
Save and close the file.
-
After restarting, verify the new limits by running:
launchctl limit maxfiles
The response output should look something like this:
maxfiles 65536 200000
Start by checking the current open file limit values with:
launchctl limit maxfiles
The response should look something like this:
maxfiles 10240 10240
The first column is the soft limit and the last column is the hard limit.
To adjust the maximum open file limits in OS X 10.7 (Lion) up to but not including OS X Yosemite, perform the following steps:
- Edit (or create)
/etc/launchd.conf
and increase the limits by adding:
limit maxfiles 65536 200000
-
Save the file and restart the system for the new limits to take effect.
-
After restarting, verify the new limits by running:
launchctl limit maxfiles
The response output should look something like this:
maxfiles 65536 200000