7

This question already has an answer here:

The default PID max number is 32768. To get this information type:

cat /proc/sys/kernel/pid_max 
32768

or

sysctl kernel.pid_max
kernel.pid_max = 32768

Now, I want to change this number... but I can't. Well, actually I can change it to a lower value or the same. For example:

linux-6eea:~ # sysctl -w  kernel.pid_max=32768
kernel.pid_max = 32768

But I can't do it for a greater value than 32768. For example:

linux-6eea:~ # sysctl -w  kernel.pid_max=32769
error: "Invalid argument" setting key "kernel.pid_max"

Any ideas ?

PS: My kernel is Linux linux-6eea 3.0.101-0.35-pae #1 SMP Wed Jul 9 11:43:04 UTC 2014 (c36987d) i686 i686 i386 GNU/Linux

marked as duplicate by Gilles 'SO- stop being evil', jimmij, Braiam, jasonwryan, Anthon Oct 15 '14 at 3:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    My kernel is 0.101-0.35-pae - no, it's not ;-) please post the output of uname -a in your question. – Jan Oct 14 '14 at 19:41
  • 1
    You could find more information from here. – Ramesh Oct 14 '14 at 19:45
8

The value can only be extended up to a theoretical maximum of 32768 for 32 bit systems or 4194304 for 64 bit.

From man 5 proc:

/proc/sys/kernel/pid_max  
  This file (new in Linux 2.5) 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. On 32-bit platfroms, 32768 is the maximum value for
  pid_max. On 64-bit systems, pid_max can be set to any value up to 2^22
  (PID_MAX_LIMIT, approximately 4 million).
  • My arch is x86, meaning 32-bit. So that's why I got this error. Thank you very very much sir. – drpaneas Oct 14 '14 at 21:32
  • It would be helpful to point at an explanation as to where those theoretical maximums come from. – fche Apr 12 '15 at 22:02
  • Debian 9 has default equal to 131072. – Mvorisek Jul 30 '18 at 20:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.