查看limit配置
# 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) 7257
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
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) 7257
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
其中最大进程数和最大文件打开数,需要修改一下。否则相关软件,无法启动。
环境说明
操作系统:centos 6.9
limits.conf
修改/etc/security/limits.conf
文件
在文件末尾添加
* soft nofile 204800
* hard nofile 204800
* soft nproc 204800
* hard nproc 204800
说明:
* 代表针对所有用户
noproc 是代表最大进程数
nofile 是代表最大文件打开数
90-nproc.conf
光修改上面一个文件是不行的,还需要修改一个文件。
修改/etc/security/limits.d/90-nproc.conf
文件
删掉默认配置,修改如下:
* soft nproc 204800
* hard nproc 204800
修改2个配置文件之后,重启后生效
reboot -f
查看配置
# 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) 15238
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 204800
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 204800
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
本文参考链接:
https://blog.csdn.net/xzw_123/article/details/46878459