Re: Isolated: Was: ModPython + Virtual Hosting Apache2 instance = poor performance.
Graham Dumpleton <[email protected]> Mon, 8 Mar 2010 10:06:41 +1100
| Newsgroups | gmane.comp.python.mod_python |
|---|---|
| Message-ID | <[email protected]> |
On 8 March 2010 09:28, Christopher Sean Hilton <chris-7VRIiXHg8cFWk0Htik3J/[email protected]> 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: >> >> =A0http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-u= sage.html >> > > I found this and did understand it. The practical issue for me is confi= guring FreeBSD to run with the Worker MPM but I can figure that out. In t= he 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 pro= blem goes the earlier poster correctly identified it as a threading issue= . I was able to rectify the performance issue by rebuild python w/out thr= eads and rebuilding mod_python on top of the new python. > > In the future, if you want FreeBSD + Apache + Mod_Python you would be w= ell 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 list. PS. I have cc'd this back on to the mod_python mailing list, please keep the discussion there. Graham