Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Feb 22, 2010 7:53 pm 
Offline
Newbie

Joined: Thu Feb 18, 2010 11:11 pm
Posts: 4
Website: http://japanisshinto.com
Location: Rochester, New York
I'm looking for documentation regarding when Apache will decide to kill a child process. Most of this is to satisfy my curiosity, because it doesn't seem something that's discussed much.

Let's put MaxRequestsPerChild aside. The documentation is clear on that-- after so many requests, the child process dies. On my server, I've set this to 1000 out of paranoia regarding memory leaks (in PHP and WordPress). So presumably after servicing 1000 requests, I should see the child process die.

But here's the confusing/under-documented part: My web server isn't hugely busy, so hitting 1000 requests is going to take some time. And I'm seeing child processes die well before that.

At any time, I usually have 10 child processes (MaxSpareServers) hanging around. When a surge of activity comes in, the connection backlog will grow and Apache cranks up the number of processes to handle the connections. I'll see a maximum of 32 child processes appear (ServerLimit). But within a few seconds, the number of processes will start to drop until it again gets back to the 10 child processes.

Again, it would take quite a time for the 1000 MaxRequestsPerChild to hit these processes and kill them. So what is Apache's process killing strategy? Under what other conditions will Apache kill processes?


Top
   
 Post subject:
PostPosted: Mon Feb 22, 2010 8:22 pm 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
Apache kills idle servers if there's more than MaxSpareServers of them, and spawns idle servers if there's less than MinSpareServers of them. Simple. Spawning both idle spares, and busy processes is constrained by the hard value of ServerLimit.

It's all in the mpm_prefork documentation. Well, it's a bit similiar with mpm_worker, sub-server processes and threads in them, you just get two levels of regulation there so it's a bit more complex.


Top
   
 Post subject:
PostPosted: Mon Feb 22, 2010 8:48 pm 
Offline
Newbie

Joined: Thu Feb 18, 2010 11:11 pm
Posts: 4
Website: http://japanisshinto.com
Location: Rochester, New York
rsk wrote:
Apache kills idle servers if there's more than MaxSpareServers of them, and spawns idle servers if there's less than MinSpareServers of them. Simple. Spawning both idle spares, and busy processes is constrained by the hard value of ServerLimit.


So I guess I'm asking what the definition of "idle" is then. Is it literally the moment when the process either has no longer has a connection (or if KeepAlive is on, until the timeout occurs)? Or does Apache add a fudge factor beyond that and consider a process idle after some about time without activity?


Top
   
 Post subject:
PostPosted: Tue Feb 23, 2010 6:36 am 
Offline
Senior Member
User avatar

Joined: Tue Nov 24, 2009 1:59 pm
Posts: 362
Well, the documentation doesn't mention any delays.
Quote:
The MaxSpareServers directive sets the desired maximum number of idle child server processes. An idle process is one which is not handling a request. If there are more than MaxSpareServers idle, then the parent process will kill off the excess processes.

Doesn't mean there isn't one, of course. But I think that's a question that would be better answered on the Apache mailing list. ( http://httpd.apache.org/lists.html )


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group