第一,修改/etc/security/limits.conf:

* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535

root soft nproc 65535
root hard nproc 65535
root soft nofile 65535
root hard nofile 65535

ubuntu soft nproc 65535
ubuntu hard nproc 65535
ubuntu soft nofile 65535
ubuntu hard nofile 65535

注:不同的用户都要写进来,我这里ubuntu这个普通用户也添加了进来。

 

第二,修改 /etc/pam.d/common-session和/etc/pam.d/common-session-noninteractive:

两个文件中都需要添加:session required pam_limits.so

 

第三,修改 /etc/systemd/user.conf和/etc/systemd/system.conf:

两个文件中都需要添加:DefaultLimitNOFILE=65536

posted on 2019-11-06 14:29  爱技术努力学技术  阅读(1514)  评论(0编辑  收藏  举报