1

As the title suggests, what happens when pid_max (32bit standard is 32768) is reached with many zombie-processes?

On our server a user generates a lot of suphp defunct zombie processes and this forces our server to restart... and I think this happens because the pid_max is reached...

I'm running CentOS 5.8 with Apache 2.2.3

Thanks. Best regards, John.

EDIT Thanks for the answers.

3
  • 1
    It's not clear what you mean. Are you asking what happens when you have 32,768 processes? Or are you asking what happens when you have a process with the highest possible PID? – David Schwartz Mar 20 '13 at 11:03
  • yes, i wanted to know what happens when 32,768 processes are running and a new process wants to start! – John Brunner Mar 20 '13 at 11:55
  • Please read our tour page so you can understand better how our Q&A site works. – user9517 Mar 20 '13 at 12:04
3

PIDs are generated sequentially and before being assigned to a process a check is made to ensure a process doesn't currently have a particular PID. When pid_max is reached the counter simply wraps back to the beginning. If there are no more PIDs available then no more proceses can be created and you'll get an error message "...No more processes."

3
  • thanks for the answer. sounds clear. maybe you have an answer for my modified question too? – John Brunner Mar 20 '13 at 11:59
  • @JohnBrunner: This isn't how SE & SF work. You ask a question and get answers. If you asked the wrong question, then you should ask a new question and if necessary refer to the earlier one. If answers are useful you should upvote them and consider accepting one. – user9517 Mar 20 '13 at 12:03
  • allright. i will start a new question. thanks for the help! – John Brunner Mar 20 '13 at 12:25
2

If there are no available PIDs, then new processes cannot be created. Some operating systems reserve a few PIDs for the root user.

PIDs are re-used though. So if there's an available PID, it will be used.

1
  • thanks for the answer. sounds clear. maybe you have an answer for my modified question too? – John Brunner Mar 20 '13 at 11:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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