Linux Increase Process Identifiers Limit with /proc/sys/kernel/pid_max
Yesterday I wrote about increasing local port range with net.ipv4.ip_local_port_range proc file. There is also /proc/sys/kernel/pid_max file, which specifies the value at which PIDs wrap around (i.e., the value in this file is one greater than the maximum PID). The default value for this file, 32768, results in the same range of PIDs as on earlier kernels (<=2.4). The value in this file can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately 4 million).
Increasing the value will help on large Linux system or clusters to ease process identification and process management. You can easily prevent fork() failures error message with this hack.
Display Current Process Identifiers Limit
Type the following command at shell prompt:
$ sysctl kernel.pid_max
OR
$ cat /proc/sys/kernel/pid_max
Output:
kernel.pid_max = 32768
Allow for more PIDs
Type the following command
# sysctl -w kernel.pid_max=4194303
You need to append the following to your /etc/sysctl.conf:
kernel.pid_max = 4194303
Please note that this hack is only useful for large and busy server, don't try this on old kernel or desktop systems.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or full RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in...
- Linux Increase Local Port Range with net.ipv4.ip_local_port_range
- Linux Apache setting Perl CGI Script Limits
- How to: Prevent a fork bomb by limiting user process
- FreeBSD: Password expiry / aging policy
- Experimenting with Blogrush
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: Increase pid limits, kernel.pid_max, linux system, pid, process management ~ Last updated on: November 2, 2007



Recent Comments
Today ~ 2 Comments
Today ~ 4 Comments
Today ~ 8 Comments
Today ~ 3 Comments
Today ~ 2 Comments