Increase the number of files a node may have open at a time

This commit is contained in:
Michael Vines
2018-12-15 08:42:56 -08:00
parent e5d1bd6589
commit 74ee1e5087
6 changed files with 25 additions and 17 deletions

17
scripts/ulimit-n.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Adjust the maximum number of files that may be opened to as large as possible.
#
maxOpenFds=65000
if [[ $(uname) = Darwin ]]; then
maxOpenFds=24576 # Appears to be the max permitted on macOS...
fi
if [[ $(ulimit -n) -lt $maxOpenFds ]]; then
ulimit -n $maxOpenFds || {
echo "Error: nofiles too small: $(ulimit -n). Run \"ulimit -n $maxOpenFds\" to continue";
exit 1
}
fi