1

I am running django with mod_wsgi in my server and every thing works fine most of the time but at times apache suddenly stops serving requests and the site stops loading.

I think it is similar to the following issues reported earlier here.

https://serverfault.com/questions/415397/apache-stops-serving-request

Apache stops processing requests (mod_wsgi?)

But I think I have the proper wsgi configuration set seeing the suggestions of @Graham Dumpleton . I am providing my configuration.

WSGIScriptAlias / /home/mobilewe/public_html/daily.wsgi
WSGIDaemonProcess daily user=mobilewe group=mobilewe processes=10 threads=15 display-name=%{GROUP}    
WSGIProcessGroup daily
WSGIApplicationGroup %{GLOBAL}

I have set "info" loglevel for apache and this is what I can see in the logs.

[Thu Jan 30 16:47:21 2014] [info] mod_wsgi (pid=7232): Destroying interpreters.
[Thu Jan 30 16:47:21 2014] [info] mod_wsgi (pid=7232): Cleanup interpreter ''.
[Thu Jan 30 16:47:21 2014] [info] mod_wsgi (pid=7232): Terminating Python.
[Thu Jan 30 16:47:21 2014] [info] mod_wsgi (pid=7232): Python has shutdown.
[Thu Jan 30 16:47:21 2014] [info] [client 76.19.139.222] (32)Broken pipe: 
core_output_filter: writing data to the network
[Thu Jan 30 16:47:22 2014] [info] mod_wsgi (pid=7239): Destroying interpreters.
[Thu Jan 30 16:47:22 2014] [info] mod_wsgi (pid=7239): Cleanup interpreter ''.
[Thu Jan 30 16:47:22 2014] [info] mod_wsgi (pid=7239): Terminating Python.
[Thu Jan 30 16:47:22 2014] [info] mod_wsgi (pid=7239): Python has shutdown.

Can somebody please advise?

Community
  • 1
  • 1

1 Answers1

0

Embed this in your application and try and get some Python stack traces out of your application for the time when it is all blocked up.

Also provide some examples from the logs where it says the WSGI script file is being loaded. That will give information about what process/application group things are being loaded in and thus whether configuration is being picked up correctly.

Finally, how much traffic does this site get? Using 10 processes with 15 threads is quite a lot. One could usually run with a lot less unless you specifically have lots of long running requests.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • This is a busy site. Actually I tried to increase the number of processes and threads to 20 and 30 respectively. This issue started occurring after that. But I was not sure whether that was the issue. But we never had such an issue when it was 10 and 15. So I changed it back to 10 and 15 after I posted the issue here. The issue has not appeared again. I will update you if the issue appears again. – user3050288 Jan 31 '14 at 14:42