Objective
Use environment: CentOS 7 System
First, view the maximum number of processes opened by the user
Ulimit-a
MAX User Processes (-u) #系统限制某用户下最多可以运行多少进程或线程
How are these values coming from?
The value of MAX user processes, which appears under root account ulimit-u, defaults to the value of # Cat/proc/sys/kernel/threads-max/2, which is half the number of system threads
The value of MAX user processes that appears in Ulimit-u under normal account defaults to/etc/security/limits.d/20-nproc.conf (CENTOS6 is 90-nproc.conf) file
Third, how to modify this value 1. In the/etc/security/limits.conf file, add the following: * Soft Nproc 65535 # Open Process number * Hard Nproc 65535 # Open processes how to:
echo "* Soft Nproc 65535" >>/etc/security/limits.conf
echo "* Hard Nproc 65535" >>/etc/security/limits.conf
Note: The normal user max User process value is not valid here, and the value in the/etc/security/limits.d/20-nproc.conf file needs to be modified.
If you use the * number to make the global user effective is constrained by the size of the nproc value in file/etc/security/limits.d/20-nproc.conf , and if it is only for a user, it is not affected by the size of the Nproc value of the file.
2. Modify/etc/security/limits.d/20-nproc.conf
Because the average user is affected by the value in this file
Modified to:
* Soft Nproc 65535
3. Total system Limitations
In fact, the value of MAX user processes 65535 above is only a representation, the average user maximum number of processes cannot reach 65535, because the user's max user processes value, and finally is subject to the global Kernel.pid_max value limit. That is kernel.pid_max=1024, then the value of your user's Max user processes is 127426, the maximum number of processes the user can open or 1024.
to view the global Pid_max method:Method One: Cat/proc/sys/kernel/pid_max method two: # Sysctl Kernel.pid_maxkernel.pid_max = 32768
Modify this value method:
echo 65535 >/proc/sys/kernel/pid_max So when the above is done, the value of max user processes is correctly modified
Number of Linux max processes