On 8 April 2010 00:02, Sharjeel Qureshi <[email protected]> wrote:
> I am having problems with my Django Based application. The server
> stops responding occasionally, starts creating lot of processes until
> it is restarted. Even when I shutdown apache, lot of apache processes
> can be seen with "ps -aux | grep apache" command so I also have to do
> "sudo killall -v apache2".
>
> My setup is on a 64-bit Ubuntu 8.04 machine. Main webserver is nginx
> (which gives a 502 server timeout when it happens). It is connected to
> Apache 2.2 via reverse proxy. Apache is using MPM-Prefork and runs the
> mod_wsgi in daemon mode with a single process. The application is
> using django 1.1
>
> Here is my system configuration
>
> Ubuntu 6.04
> nginx for static content, reverse proxied with apache (nginx stays
> stable and gives 502 server timeout)
> Apache 2.2, mpm-prefork, maxclients=150
> Mod_wsgi 2.7, processes=1
> mod_python is NOT installed
> django 1.1
>
> I usually don't get more than 10 requests at each time but the process
> count becomes way higher than it should.
>
> I've changed the log level of both core apache as well as the virtual
> host. In the errors log I've found following:
>
> a) [error] [client 127.0.0.1] mod_wsgi (pid=23988): Exception occurred
> processing WSGI script '/home/www/example.com/apache2/django.wsgi'.
> b) [error] [client 127.0.0.1] IOError: failed to write data
> c) [info] [client 127.0.0.1] (32)Broken pipe: core_output_filter:
> writing data to the network
> d) [error] [client 127.0.0.1] (4)Interrupted system call: mod_wsgi
> (pid=24215): Unable to connect to WSGI daemon process 'snr' on '/var/
> run/apache2/wsgi.23609.0.1.sock' after multiple attempts.
> e) lots of: [error] [client 127.0.0.1] Premature end of script
> headers: django.wsgi
>
> I have similar setup running on three other instances but never had
> problems on them strangely!
>
> Any ideas?

Are you ever seeing any of the messages:

  Daemon process deadlock timer expired, stopping process ...

  Segmentation Fault

When you see the message:

  Premature end of script headers

are you seeing messages indicating that the daemon process has restarted?

Ensure you check both main Apache error log and any virtual host
specific error log for messages.

At least while work this out, you can add option:

  inactivity-timeout=120

to WSGIDaemonProcess and should hopefully cause process to restart
automatically after being stuck for 2 minutes. At least then if you
can't get to it quickly yourself to restart Apache, it should fix
itself up.

BTW, do you have a specific need to run prefork MPM? If you don't, ie,
not running mod_php, you would be better off with worker MPM.

Also post the actual existing WSGIDaemonProcess/WSGIProcessGroup lines
you are using now.

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