On 11 May 2010 08:24, Alec Flett <[email protected]> wrote:
> We've seen an interesting problem lately while running daemon mode with a 
> large number of Apache children..
>
> The basic issue is that we have apache with MaxClients at 600  -which is 
> high, I know - and 24 mod_wsgi children. (We have a lot of RAM, and this is a 
> 8 CPU box) - so requests come in and apache queues them up. Under load, the 
> mod_wsgi daemons are pretty busy, and the apache children start to pile up 
> waiting to be served.
>
> This is all well and good and we figured this was a good way to absorb load 
> spikes, but we've seen something strange. When the client (i.e. browser, or 
> whatever) times out, and drops the socket on apache, the request seems to 
> already be queued up for mod_wsgi to run. So even after the HTTP connection 
> has dropped, mod_wsgi chews on the request anyway...
>
> Is this known behavior in mod_wsgi, or does it at least make sense for the 
> way mod_wsgi is today, or does this sound like something else? We are likely 
> going to drastically reduce MaxClients but I wanted to run this hypothesis by 
> this list to see if we're evaluating this right.

This is logical given that you have configured Apache server child
processes to be able to accept more requests than can be funnelled
into the mod_wsgi daemon processes. The Apache server child processes
will be blocked on the connect() call to the mod_wsgi daemon processes
waiting for them to call accept() on the listener socket. When it
finally connects it will straight away start trying to proxy data from
client across to daemon process. If client had disconnected, only when
it attempts to read data from client will it know that. This is
because Apache uses blocking threads and not an event driven
select/poll loop.

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to