默认以下操作在root身份下进行
mv /etc/security/limits.conf /etc/security/limits.conf.backup
vim /etc/security/limits.conf
#root账⼾的资源软限制和硬限制 (Ubuntu需要添加上下两部分)
root soft core unlimited
root hard core unlimited
root soft nproc 1000000
root hard nproc 1000000
root soft nofile 1000000
root hard nofile 1000000
root soft memlock 32000
root hard memlock 32000
root soft msgqueue 8192000
root hard msgqueue 8192000
#其他账⼾的资源软限制和硬限制 (centos系统只需要下面这一部分即可)
* soft core unlimited
* hard core unlimited
* soft nproc 1000000
* hard nproc 1000000
* soft nofile 1000000
* hard nofile 1000000
* soft memlock 32000
* hard memlock 32000
* soft msgqueue 8192000
* hard msgqueue 8192000
配置文件
mv /etc/sysctl.conf /etc/sysctl.conf.backup
vim /etc/sysctl.conf