您的位置:首页 > 运维架构 > Linux

linux 6.4下max_user_processes和open_file修改

2014-10-17 16:13 477 查看
这里只介绍一种永久性的修改方式

使用root用户修改配置文件:/etc/security/limits.conf

增加如下内容

* soft nproc 10240

* hard nproc 10240

* soft nofile 10240

* hard nofile 10240

其中nofile对应open_files

nproc对应max_user_processes

但是在Linux 6.4之后,如果只修改了该文件中的nproc,那么其他非root用户对应的max_user_processes并不会改变,仍然是1024,这个是因为受到了下面这个文件的影响

/etc/security/limits.d/90-nproc.conf

查看一下:

[root@rhf ~]# cat /etc/security/limits.d/90-nproc.conf

# Default limit for number of user's processes to prevent

# accidental fork bombs.

# See rhbz #432903 for reasoning.

* soft nproc 1024

root soft nproc unlimited

此时有两种方法解决该问题:

1、修改/etc/security/limits.d/90-nproc.conf将

* soft nproc 1024

修改为:

* soft nproc 10240

2、修改/etc/security/limits.conf,将

* soft nofile 10240

修改为

oracle soft nofile 10240

我现在一般采用第一种方法
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: