On 25 August 2010 01:28, Maria <[email protected]> wrote:
> We've got several instances of a django application (basically the
> same code, but different settings files) running under modwsgi 2.8.
> We initially had them running under a single WSGIProcessGroup, but saw
> some occasional bugs with this and realized that each instance needed
> a separate process group.  We switched to one WSGIDaemonProcess and
> WSGIProcessGroup per VirtualHost, configured basically as follows:
>
>    WSGIDaemonProcess foo user=www-data group=www-data processes=2
> threads=6 maximum-requests=1000 display-name=foo
>
> When we made the change, the original errors disappeared, but we've
> got a new problem.  Every now and then apache just completely freezes
> up, across all the process groups, and the only thing to do is an
> apache restart.  There's nothing meaningful in the apache logs.  We
> tried adding "deadlock-timeout=90" to the process groups, thinking it
> might be a deadlock trying to get the GIL, but the very next hang
> lasted well over this timeout.
>
> Any thoughts on what might be causing this or suggestions on where to
> investigate more?  Thanks.

Are the right number of mod_wsgi daemon process still visible in 'ps' output?

If you have only single Django instance per daemon process group, then
force them to run in the main interpreter rather than a sub
interpreter of the process. This will eliminate problems caused by
third party extension modules for Python which don't handle threading
in sub interpreters properly. You can force use of main interpreter by
adding:

  WSGIApplicationGroup %{GLOBAL}

I cant suggest anything else with knowing what Apache MPM you are
using and what MPM settings are, what you have KeepAlive and Timeout
set to in Apache.

The latter are important because you simply could have configured
Apache poorly and don't have enough processes/threads for Apache
itself (not mod_wsgi daemon mode) and a burst of requests means you
run out of idle threads due to keep alive keeping client connections
open and not releasing them for reuse immediately.

BTW, are you using same Apache to serve static media files?

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