Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

(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/
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.

share|improve this question

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.

share|improve this answer
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 which calls libgettext via ctypes. It has pure-python alternative, so we can check it uses that. – Jan Hudec Apr 11 '13 at 5:51
What do you mean 'No, there is only one WSGIApplicationGroup'? You don't list it in your configuration. Use… to work out whether you are in fact running in the main interpreter or not. – Graham Dumpleton Apr 12 '13 at 3: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 7:37
So change 'WSGIApplicationGroup pootle' to 'WSGIApplicationGroup %{GLOBAL}' is what I am saying. Further reading at…… – Graham Dumpleton Apr 12 '13 at 12:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.