$ 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) 5000
pipe size (512 bytes, -p) 1
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 709
virtual memory (kbytes, -v) unlimited
$ ulimit -n
256
$ ulimit -n 5000
$ ulimit -n
5000
$ sysctl kern.maxfiles
kern.maxfiles: 5000
$ sysctl kern.maxfilesperproc
kern.maxfilesperproc: 5000
$ sudo sysctl -w kern.maxfiles=5000
kern.maxfiles: 12288 -> 5000
$ sudo sysctl -w kern.maxfilesperproc=5000
kern.maxfilesperproc: 10240 -> 5000
参考文献:
http://blog.csdn.net/whereismatrix/article/details/50582919
http://ronglei0324.blog.163.com/blog/static/676332232013122112049188/