system-auth
for authentication if this module is configured in the /etc/pam.d/login
configuration file. By default, the system-auth
module introduces the pam_limits.so
module. The default system-auth
configuration is as shown below:
pam_limits.so
module is mainly used to limit the use of system resources during the user session. Its default configuration file /etc/security/limits.conf
specifies the maximum number of files, the maximum number of threads, the maximum memory and other resources that a user can use. See the table below for details.Parameter | Description |
soft nofile | The maximum number of open file descriptors (soft limit) |
hard nofile | The maximum number of open file descriptors (hard limit), which cannot be exceeded. |
fs.file-max | The maximum number of open file handles (struct file in the kernel) at the system level. |
fs.nr_open | The maximum number of file descriptors (fd) assigned to a process |
/etc/security/limits.conf
configuration file. The set value of soft nofile
should be no more than hard nofile
, and hard nofile
should be no more than fs.nr_open
.soft nofile
, hard nofile
and fs.nr_open
.soft nofile ≤ hard nofile ≤ fs.nr_open
.soft nofile
and hard nofile
./etc/security/limits.conf
fs.nr_open
value.sysctl -a 2>/dev/null | grep -Ei "file-max|nr_open"
/etc/security/limits.conf
file to add or modify the following configurations at the end of the file.root soft nofile
: 100001root hard nofile
: 100002/etc/sysctl.conf
file to add or modify the following configurations at the end of the file.soft nofile ≤ hard nofile ≤ fs.nr_open
is met. Perform this step to increase the system limit.fs.file-max
= 2000000fs.nr_open
= 2000000sysctl -p
Was this page helpful?