博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux 6.4下max_user_processes和open_file修改
阅读量:7080 次
发布时间:2019-06-28

本文共 787 字,大约阅读时间需要 2 分钟。

这里只介绍一种永久性的修改方式

使用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

 

我现在一般采用第一种方法

转载于:https://www.cnblogs.com/qidongbo/p/8243846.html

你可能感兴趣的文章