ulimit-n.sh 429 B

123456789101112131415
  1. # |source| this file
  2. #
  3. # Adjust the maximum number of files that may be opened to as large as possible.
  4. #
  5. maxOpenFds=65000
  6. if [[ $(ulimit -n) -lt $maxOpenFds ]]; then
  7. ulimit -n $maxOpenFds 2>/dev/null || {
  8. echo "Error: nofiles too small: $(ulimit -n). Failed to run \"ulimit -n $maxOpenFds\"";
  9. if [[ $(uname) = Darwin ]]; then
  10. echo "Try running |sudo launchctl limit maxfiles 65536 200000| first"
  11. fi
  12. }
  13. fi