I had a weird bug.

This site is a Django web application and I use Apache and mod_wsgi to serve it up in a standard django deployment setup. I wanted to use scipy, so I pip install'ed it, and then… nothing!

My Django application appeared to just freeze. When I open a webpage, it just hangs. There is no noticable high load or CPU or memory usage on my server. There is no apache access log or error log messages. Other static apache websites I have hosted on the same machine, with the same apache instance, work fine. It's just the Django… hanging.

This is a weird problem, and is caused by scipy being a python library that's written in C, and there's some complication with the python GIL and mos_wsgi, which means it'll hang.

Luckily, there's a simple fix. You have to add this line to your Apache configuration file.

WSGIApplicationGroup %{GLOBAL}

And then it all works fine.

source

Published on

Tags:

    Previous Post: Next Post

    Back to Celtic Knot Creator blog