httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: strange usage pattern for child processes
Date Thu, 16 Oct 2008 16:20:46 GMT


On 10/16/2008 02:35 PM, Lars Eilebrecht wrote:
> Ruediger Pluem wrote:
> 
>> This is a pity, because then it will become much harder to debug
>> this issue. Any chance you get shell access or that you can instruct
>> the administrators in the service company to get the needed information
>> for you?
> 
> Getting shell access is very unlikely ...
> However, initial tests using mod_disk_cache have been very good.
> The performance of mod_mem_cache compared to mod_disk_cache is
> just very bad ... It seems the main issue is/was that under high
> load the child process(es) of Apache just starve while trying to
> read something from the mem cache or to write something to it.
> But well, without access to the box I couldn't really dig into
> what exactly is happening in such a case.

Maybe while writing as mod_mem_cache needs to do locking over all threads
during several processing phases.

> 
> 
>> Ok. MaxSpareThreads is set to 75 with ThreadsPerChild 256. This means
>> that StartServers 3 is pointless because after starting *one* process we already
>> have way too much spare threads *overall*. So the other 2 processes will get killed
>> immediately :-).
> 
> Yes you are right, I missed that MaxSpareThreads applies to all child
> processes. But I didn't wrote the config. ;-)

I have not assumed that you wrote the config :-).

> 
> However, I still find it a bit odd that we actually use only a single
> process and only start using threads of another child process once
> all threads of the other process are busy. Wouldn't it make more
> sense to keep spare threads in all child processes instead of just
> one? Especially if the config has low MaxRequestsPerChild limit.
> Or am I missing something?

Two points that can happen:

1. Because of the configuration you only have one process started. Once it reaches
   MinSpareThreads it starts a second one. Depending on the request types the
   first process still has a lot of keepalive connections and thus is more busy
   than the second process.

2. Unfair lock handling on OS side. Each process tries to get the accept mutex.
   If getting the lock is not fairly distributed over the two processes then
   one process has to handle more connections than the other one.

Given the MaxRequestsPerChild limit (why is there one at all), the configuration
is especially unfortunate as if there is only one process there are times where
httpd does not accept new connections at all until it has started an additional
process. So MPM settings should be in a way that they allow an idle system to
run more than one process.
But, who I am a telling, you didn't wrote the config :-).

Regards

RĂ¼diger

Mime
View raw message