/etc/security/limits.conf 文件说明

/etc/security/limits.conf 是 Linux 资源使用配置文件,用来限制用户对系统资源的使用

语法:<domain>  <type>  <item>  <value>

[root@localhost ~]# cat /etc/security/limits.conf
* soft nproc 65535      # 警告设定所有用户最大打开进程数为65535
* hard nproc 65535      # 严格设定所有用户最大打开进程数为65535
* soft nofile 65535     # 警告设定所有用户最大打开文件数为65535
* hard nofile 65535     # 严格设定所有用户最大打开文件数为65535
复制代码
<domain> 表示要限制的用户,可以是:

         ① 用户名
         ② 组名(组名前面加'@'以区别用户名)
         ③ *(表示所有用户)

<type> 有两个值:

         ① soft 表示警告的设定,可以超过这个设定值,但是超过会有警告信息
         ② hard 表示严格的设定,必定不能超过这个设定的值

<item> 表示可选的资源,如下:

         ① core:限制内核文件的大小
         ② data:最大数据大小
         ③ fsize:最大文件大小
         ④ memlock:最大锁定内存地址空间
         ⑤ nofile:打开文件的最大数目
         ⑥ rss:最大持久设置大小
         ⑦ stack:最大栈大小
         ⑧ cpu:以分钟为单位的最多CPU时间
         ⑨ nproc:进程的最大数目
         ⑩ as:地址空间限制
<value> 表示要限制的值
复制代码
原文地址:https://www.cnblogs.com/hyl8218/p/8464786.html