修改/etc/security/limits.conf文件,添加:
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
查看/etc/security/limits.d目录是否有文件“90-nproc.conf”,没有的话新建该文件,文件,内容写为:
* soft nproc 65535
* hard nproc 65535
退出重新登录后,使用ulimit -a查看系统参数,成功后为:
user@user:~$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7850
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 65535
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 65535
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited