Polls

Topics

Linux Increase Process Identifiers Limit with /proc/sys/kernel/pid_max

Posted by Vivek on Saturday November 3, 07 @2:13 am

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...

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!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Tags: , , , , ~ Last updated on: November 2, 2007

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.