来源:
down vote
It seems like there is an entirely different method for changing the open files limit for each version of OS X!
For OS X Sierra (10.12.X) you need to:
1. Create a file at /Library/LaunchDaemons/limit.maxfiles.plist
and paste the following in (feel free to change the two numbers (which are the soft and hard limits, respectively):
Label limit.maxfiles ProgramArguments launchctl limit maxfiles 64000 524288 RunAtLoad ServiceIPC
2. Change the owner of your new file:
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist
3. Load these new settings:
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
4. Finally, check that the limits are correct:
launchctl limit maxfiles