sh-3.2# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 1064
virtual memory (kbytes, -v) unlimited
sh-3.2# ulimit -n 1048576
ulimit: open files: cannot modify limit: Invalid argument
sh-3.2# sysctl -w kern.maxfiles=1048600
kern.maxfiles: 12288 -> 1048600
sh-3.2# sysctl -w kern.maxfilesperproc=1048576
kern.maxfilesperproc: 10240 -> 1048576
sh-3.2# ulimit -n 1048576
sh-3.2# ulimit -n
1048576
转载于:https://blog.51cto.com/chennanrun/1901815