You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Niklas Edmundsson <ni...@acc.umu.se> on 2012/12/16 17:25:11 UTC

event mpm and mod_status

Hi all.

I'm playing around with the event mpm in httpd 2.4.3, and I've come to 
the conclusion that the stats reported by mod_status is rather 
strange. I'm not sure if it's a bug or simply not implemented...

My test case is just a simple file transfer of a DVD image, no 
mod_cache etc. involved.

I then, naively perhaps, expect that I should se this file transfer on 
/server-status, but I see little to no trace of it.

I would at least expect it to consistently show up as writing 
somewhere, but "writing" under "Async connections" mostly shows 0.

Another interesting thing is that the client ip shows up all over the 
place in the server/thread list, but without any info on what the 
client is doing. I'm guessing that this is the async processing going 
on, but the status shown on /server-status is just plain confusing.

Am I missing something?

Sure, I can look in the server logs to find out what files have been 
sent, but that's not quite the same as the "what is happening right 
now" I'm used to /server-status presenting to me.

Is it possible to patch mod_status to show something useful for the 
event mpm too, or is the information needed not available? For 
example, I would expect to find a list of all the current requests 
being processed somehow. As it currently stands it seems that all 
replies currently being sent in async mode is a "black hole" on 
/server-status.



/Nikke
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     nikke@acc.umu.se
---------------------------------------------------------------------------
  OH NO, my wife burned the rice crispies--AGAIN!!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: event mpm and mod_status

Posted by Niklas Edmundsson <ni...@acc.umu.se>.
On Mon, 17 Dec 2012, Stefan Fritsch wrote:

> On Sunday 16 December 2012, Niklas Edmundsson wrote:
>> I'm playing around with the event mpm in httpd 2.4.3, and I've come
>> to the conclusion that the stats reported by mod_status is rather
>> strange. I'm not sure if it's a bug or simply not implemented...
>>
>> My test case is just a simple file transfer of a DVD image, no
>> mod_cache etc. involved.
>>
>> I then, naively perhaps, expect that I should se this file transfer
>> on /server-status, but I see little to no trace of it.
>>
>> I would at least expect it to consistently show up as writing
>> somewhere, but "writing" under "Async connections" mostly shows 0.
>
> It should alternate between "Async connections/writing" and
> "threads/busy". If not, then that's a bug.

Ah, it should alternate. I'll check this for this when I get round to 
doing some more testing.

I get the underlying reason for this behaviour, but from the viewpoint 
of a generic server admin without grasp of the underlying code it gets 
slightly confusing when stuff bounces around like that.

I'll double check if I have missed some docco, and cobble up a 
suggestion for improvement if I find that it's unclear/missing.


>> Another interesting thing is that the client ip shows up all over
>> the place in the server/thread list, but without any info on what
>> the client is doing. I'm guessing that this is the async
>> processing going on, but the status shown on /server-status is
>> just plain confusing.
>>
>> Am I missing something?
>
> Maybe a scoreboard update call is missing at some point. I will have
> to look at it.
>
> The fact that the client ip shows up on all threads points to some
> potential optimization: Recently active threads should be preferred,
> because their memory is more likely to be in the cpu caches. Right
> now, the thread that has been idle the longest time will do the work.

Ah, virtually guaranteeing that the thread with the coldest cache gets 
to do the work...

I definitely agree on the potential for improvement here, you would 
most likely want to select either the thread that processed this 
request last time, or the most recently active idle thread. These two 
conditions kinda collides though, so the challenge is probably to come 
up with some rather cheap selection algorithm that is good enough.

>> Sure, I can look in the server logs to find out what files have
>> been sent, but that's not quite the same as the "what is happening
>> right now" I'm used to /server-status presenting to me.
>>
>> Is it possible to patch mod_status to show something useful for the
>> event mpm too, or is the information needed not available? For
>> example, I would expect to find a list of all the current requests
>> being processed somehow. As it currently stands it seems that all
>> replies currently being sent in async mode is a "black hole" on
>> /server-status.
>
> The problem is that there is no fixed limit for the number of
> connections being processed, which makes it hard to put that
> information into a shared memory table. And without that, there is no
> way for the process handling the server-info request to get the
> information from the other processes. But I agree that this should be
> fixed somehow.

Some kind of mechanism to extract the info when needed might be 
preferred, as it would mean zero impact except when you're accessing 
/server-status, but I don't know enough of the innards of httpd/event 
to say if it's even possible.

An alternative could be to use the socache stuff to track this for 
those that can take the performance impact (in our application, 
large-file serving, it would be negligable impact for example).


/Nikke
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Niklas Edmundsson, Admin @ {acc,hpc2n}.umu.se      |     nikke@acc.umu.se
---------------------------------------------------------------------------
  Something Evil has happened unexpectedly.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Re: event mpm and mod_status

Posted by Stefan Fritsch <sf...@sfritsch.de>.
On Sunday 16 December 2012, Niklas Edmundsson wrote:
> I'm playing around with the event mpm in httpd 2.4.3, and I've come
> to the conclusion that the stats reported by mod_status is rather
> strange. I'm not sure if it's a bug or simply not implemented...
> 
> My test case is just a simple file transfer of a DVD image, no
> mod_cache etc. involved.
> 
> I then, naively perhaps, expect that I should se this file transfer
> on /server-status, but I see little to no trace of it.
> 
> I would at least expect it to consistently show up as writing
> somewhere, but "writing" under "Async connections" mostly shows 0.

It should alternate between "Async connections/writing" and 
"threads/busy". If not, then that's a bug.

> Another interesting thing is that the client ip shows up all over
> the place in the server/thread list, but without any info on what
> the client is doing. I'm guessing that this is the async
> processing going on, but the status shown on /server-status is
> just plain confusing.
> 
> Am I missing something?

Maybe a scoreboard update call is missing at some point. I will have 
to look at it.

The fact that the client ip shows up on all threads points to some 
potential optimization: Recently active threads should be preferred, 
because their memory is more likely to be in the cpu caches. Right 
now, the thread that has been idle the longest time will do the work.

> Sure, I can look in the server logs to find out what files have
> been sent, but that's not quite the same as the "what is happening
> right now" I'm used to /server-status presenting to me.
> 
> Is it possible to patch mod_status to show something useful for the
> event mpm too, or is the information needed not available? For
> example, I would expect to find a list of all the current requests
> being processed somehow. As it currently stands it seems that all
> replies currently being sent in async mode is a "black hole" on
> /server-status.

The problem is that there is no fixed limit for the number of 
connections being processed, which makes it hard to put that 
information into a shared memory table. And without that, there is no 
way for the process handling the server-info request to get the 
information from the other processes. But I agree that this should be 
fixed somehow.