I'm utilizing a Apache + mod-wsgi + django setup on Windows with python 2.7. It seems that the only setup that is possible on Windows for mod-wsgi is having 1 process with many child worker threads. Because of this, it seems that some work may be subject to GIL. I've noticed that database requests don't appear to cause locks, but some python processing does cause locking/slowdown.
For example:
If I'm processing a large xml file using lxml via soaplib, it causes massive slowdowns. Reading the documentation, it seems the solution to this is to use WSGIApplicationGroup %{GLOBAL}
. Side note, does this even work in Windows?
If I'm doing a large list processing job via python natively that is CPU intensive, it also seems to slow other requests.
I'm wondering if there is a general class of work that will cause django/python to lock until it's finished. And if so, what are some best practices to avoid these issues?