ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
max open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 4096
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
中max open files就是要修改的数值。
临时修改可以直接使用 ulimit -n 524228修改,如果要永久修改,则需要修改配置文件:
sudo vi /etc/security/limits.conf
在末尾修改如下两项:
* hard nofile 524288
* soft nofile 524288