Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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. –  Iain Mar 20 '13 at 12:04

2 Answers 2

up vote 1 down vote accepted

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

share|improve this answer
    
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. –  Iain 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

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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