solana/scripts/ulimit-n.sh
Michael Vines c8ed41167a
Factor tune_system() out of multinode-demo/ (#4138)
* Remove x bit from ulimit-n.sh

* Factor tune_system() out of multinode-demo/
2019-05-03 10:40:02 -07:00

17 lines
418 B
Bash

# |source| this file
#
# Adjust the maximum number of files that may be opened to as large as possible.
#
maxOpenFds=65000
if [[ $(ulimit -n) -lt $maxOpenFds ]]; then
ulimit -n $maxOpenFds || {
echo "Error: nofiles too small: $(ulimit -n). Failed to run \"ulimit -n $maxOpenFds\"";
if [[ $(uname) = Darwin ]]; then
echo "Try running |sudo launchctl limit maxfiles 65536 200000| first"
fi
}
fi