On 28/02/2015, at 2:34 PM, Graham Dumpleton <[email protected]> wrote:

> 
> On 28/02/2015, at 11:37 AM, Greg Janée <[email protected]> wrote:
> 
>> Hi, I've got a Apache/mod_wsgi/Django application that's been working very 
>> well.  It performs certain kinds of requests that typically take .5s to 3s 
>> to complete.  Lately the system has been under heavier load, with perhaps 
>> 10-20 requests being processed in parallel.  Everything works fine, with the 
>> requests still being completed in under 3s, except every once in awhile 
>> (like, every 50-100,000 transactions), one request will take over 3min.  It 
>> feels like some kind of lock starvation problem.
>> 
>> I've confirmed that it's not in my application.  On a request that takes 
>> 3min, my code is not getting the request for 3min, and then it's processing 
>> it at the normal speed.  So there's some hangup above me, and I feel like it 
>> has something to do with Apache/mod_wsgi threads.
>> 
>> My setup:
>>  Apache 2.2.17, prefork, all default parameters regarding number of servers, 
>> etc.
>>  mod_wsgi 3.3
>>  WSGIDaemonProcess site-1 threads=50 shutdown-timeout=60
>> 
>> Therefore, wsgi.multiprocess is False and wsgi.multithread is True.  (N.B.: 
>> due to the current architecture of the application, it must run within a 
>> single process.)
>> 
>> Any hints where I should start looking?  This is obviously a difficult 
>> problem to diagnose because it doesn't happen very frequently.
>> 
>> I must say, I'm a little confused by what's really happening at the 
>> process/thread level.  I'm running in single daemon, multiple thread mode, 
>> but when I get lots of requests in parallel, Apache creates lots of child 
>> processes, which doesn't really make sense to me (aren't all requests 
>> getting funneled to the daemon?).  Should I be using Apache's "worker" MPM 
>> mode?
> 
> Before I explain a few things, can you tell me what you have the Timeout 
> directive set to in Apache?
> 
> Also, do you have  the WSGIProcessGroup directive definitely set so that 
> requests are delegated to the daemon mode process?
> 
> And finally, do you have WSGIApplicationGroup directive set at all?

Also, you say:

"""I've confirmed that it's not in my application.  On a request that takes 
3min, my code is not getting the request for 3min, and then it's processing it 
at the normal speed.  So there's some hangup above me, and I feel like it has 
something to do with Apache/mod_wsgi threads."""

How have you determined this?

Graham

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to