Created
December 28, 2017 20:17
-
-
Save supercoffee/773c62a663cb3ad2ba4f2e28acaafa57 to your computer and use it in GitHub Desktop.
Increase open file limit on MacOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat > /tmp/limit.maxfiles.plist << EOF | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>limit.maxfiles</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>launchctl</string> | |
<string>limit</string> | |
<string>maxfiles</string> | |
<string>64000</string> | |
<string>128000</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>ServiceIPC</key> | |
<false/> | |
</dict> | |
</plist> | |
EOF | |
sudo cp /tmp/limit.maxfiles.plist /Library/LaunchDaemons | |
sudo chown root:wheel /Library/LaunchDaemons/limit.maxfiles.plist | |
sudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source
Works on MacOS Sierra, other versions untested.
Persists settings across reboots.
#Usage
chmod +x file-limit-hax.sh
./file-limit-hax.sh