Configuration method for pid_max to limit the number of processes under Linux

  • 2020-09-28 09:18:45
  • OfStack

This is the pid_max parameter I stumbled upon while reading the warning instructions for another product.

The original Linux kernel used pid_max to control the number of processes.

Do some simple experiments to demonstrate how to get the current configuration value:


# cat /proc/sys/kernel/pid_max
32768
# sysctl -a|grep pid_max
kernel.pid_max = 32768

Here is the sysctl command's help.


# sysctl -h
Usage:
 sysctl [options] [variable[=value] ...]
Options:
 -a, --all   display all variables
 -A     alias of -a
 -X     alias of -a
  --deprecated  include deprecated parameters to listing
 -b, --binary   print value without new line
 -e, --ignore   ignore unknown variables errors
 -N, --names   print variable names without values
 -n, --values   print only values of a variables
 -p, --load[=] read values from file
 -f     alias of -p
  --system   read values from all system directories
 -r, --pattern 
      select setting that match expression
 -q, --quiet   do not echo variable set
 -w, --write   enable writing a value to variable
 -o     does nothing
 -x     does nothing
 -d     alias of -h
 -h, --help  display this help and exit
 -V, --version output version information and exit
For more details see sysctl(8).

Resources:

linux process for maximum modify https: / / www ofstack. com article / 143664. htm
Explanation linux system under the scope of pid as https: / / www ofstack. com article / 143665. htm
Linux https ways of creating process of 65535: / / www ofstack. com article / 143667. htm

conclusion


Related articles: