0

A WSGI daemon on our public-facing web server died and required reloading apache configuration to start it again. All the error.log says is:

Script timed out before returning headers: wsgi.py

(and the same message with ,referer:url appendend). I can't find any other log and don't see any obvious way to enable other diagnostics in mod-wsgi. According to process listing the thread ceased to exit. Does anybody know where to look or what configuration to add to get more information next time it happens?

The daemon is configured like

WSGIScriptAlias /pootle /usr/share/doc/pootle/wsgi.py
WSGIDaemonProcess pootle user=pootle group=pootle processes=1 threads=3 stack-size=1048576 maximum-requests=10 inactivity-timeout=30 display-name=%{GROUP}
WSGIProcessGroup pootle
WSGIApplicationGroup pootle
WSGIPassAuthorization On

the maximum-requests being so low because the application seems to be leaking memory (fortunately this application is not that critical and has just few users). Apache, wsgi and django are versions (Debian Squeeze):

  • apache2-mpm-prefork 2.2.16-6+squeeze11
  • libapache2-mod-wsgi 3.3-2
  • python-django 1.2.3-3+squeeze5
  • python-django-djblets 0.5.10~alpha0+git201005030944-2
  • python-django-registration 0.7-2

It is the only wsgi application running on this server; there are some other, more important applications on the same server, but in PHP.

Jan Hudec
  • 275
  • 3
  • 13

1 Answers1

3

I would recommend Apache 2.2.18 or later at least. There was a higher incidence of similar issues with Apache versions around 2.2.15-2.2.17. Have not had issues with newer Apache versions as much.

Also, are you using:

WSGIApplicationGroup %{GLOBAL}

If you are using a third party package for Python which has a C extension and it isn't implemented correctly to work in sub interpreters, it can lock up. The solution is to force the use of the main interpreter using that directive.

Graham Dumpleton
  • 6,090
  • 2
  • 21
  • 19
  • No, there is only one WSGIApplicationGroup. Seems we should upgrade to Wheezy quickly when it's released. It is frozen already, so hopefuly it will be released soon. The application should be pure python or at most it may be using `translate.store.cpo` which calls libgettext via ctypes. It has pure-python alternative, so we can check it uses that. – Jan Hudec Apr 11 '13 at 05:51
  • What do you mean 'No, there is only one WSGIApplicationGroup'? You don't list it in your configuration. Use http://code.google.com/p/modwsgi/wiki/CheckingYourInstallation#Sub_Interpreter_Being_Used to work out whether you are in fact running in the main interpreter or not. – Graham Dumpleton Apr 12 '13 at 03:58
  • I've added it in the question when writing the above comment. I've now added all the other options too. To be honest I am rather confused about how these relate together, the documentation is not too good at explaining it. In this server it is the only use of WSGI. – Jan Hudec Apr 12 '13 at 07:37
  • So change 'WSGIApplicationGroup pootle' to 'WSGIApplicationGroup %{GLOBAL}' is what I am saying. Further reading at http://code.google.com/p/modwsgi/wiki/ApplicationIssues#Python_Simplified_GIL_State_API http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup – Graham Dumpleton Apr 12 '13 at 12:30