2018-12-15 08:42:56 -08:00
|
|
|
#!/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 || {
|
2018-12-18 13:46:37 -08:00
|
|
|
echo "Error: nofiles too small: $(ulimit -n). Failed to run \"ulimit -n $maxOpenFds\"";
|
2018-12-15 08:42:56 -08:00
|
|
|
}
|
|
|
|
fi
|
|
|
|
|