[mod_python] mod_python slowness

Alex Turner aturner at neteconomist.com
Tue May 13 09:02:25 EST 2003

I have a scripts that takes an XML document, munges it and turns it into
HTML to be outputed to the user.  It's setup so that it will run either as
a request handler in mod_python or as a stand alone application.  I am
having extreme problem with the script being slow when running in
mod_python.  I have done some timings, and it is 10-20 times slower
that it is standalone.  The program makes calls to a Postgresql database
using the stock pg module.  The system is running mod_python 3.0.3
w/apache 2.0.43.  I just upgraded to mod_python 3.0.3 to see if that would
help and it didn't.  Everything else is stock RedHat 8.0 - python-2.2.1-17.

I can't seem to use the profiler to narrow down the problem at all because 
I can't seem to figure out how to execute the profiler on a function that 
takes arguments, and all the functions take at least the HTTP request 
object as an argument, which makes it hard to use the python profiler.  
Even so the script runs fine stand alone.  The one page I am looking at 
goes from 2.2 seconds to 23 seconds.

Has anyone had any similar issues?

Alex Turner

More information about the Mod_python mailing list