Isolated: Was: [mod_python] ModPython + Virtual Hosting Apache2 instance = poor performance.

Graham Dumpleton graham.dumpleton at
Sun Mar 7 18:06:41 EST 2010

On 8 March 2010 09:28, Christopher Sean Hilton <chris at> wrote:
> On Mar 7, 2010, at 4:28 AM, Graham Dumpleton wrote:
>> FWIW, run mod_python with prefork Apache and with a configuration set
>> up for PHP and static file hosting alone is a bad idea. Read:
> I found this and did understand it. The practical issue for me is configuring FreeBSD to run with the Worker MPM but I can figure that out. In the end the issue is the prefork MPM and I will switch to using mod_wsgi + Worker MPM. But I still needed a short term solution. As far as this problem goes the earlier poster correctly identified it as a threading issue. I was able to rectify the performance issue by rebuild python w/out threads and rebuilding mod_python on top of the new python.
> In the future, if you want FreeBSD + Apache + Mod_Python you would be well served to build Python without threads or use a different combination of tools to get the jog done.

You said you were using PHP, so you cant use worker MPM with Apache.
You can still use mod_wsgi with prefork MPM, just ensure you run WSGI
application in daemon mode of mod_wsgi to avoid issues discussed in
article. Do note though that you can't use mod_wsgi with a Python
installation which hasn't been compiled with thread support. You also
cannot use daemon mode with a APR library for Apache that doesn't have
thread support.

Rebuilding Python without threading should not cause such a dramatic
improvement especially considering I recollect you had only loaded
mod_python and not used it. I would suggest your rebuilding has seen
some other change. I also don't know what earlier post you are talking
about as there was no such post in this current thread on mod_python

PS. I have cc'd this back on to the mod_python mailing list, please
keep the discussion there.


More information about the Mod_python mailing list