[mod_python] Performance Problem

Graham Dumpleton grahamd at dscpl.com.au
Thu Aug 18 18:18:44 EDT 2005


Julien wrote ..
> I don't think it's possible (not sure) because mod_python starts many
> python instances, so mod_python cannot keep python objects ...

This is not strictly true.

For any particular Python interpreter, that is generally 1 per process,
the modules once loaded into the interpreter will remain loaded. The
value of any global data within a specific module is thus retained
between requests which hit that specific interpreter.

Obviously, different interpreters will have their own copy of the data
value, but at least for the one interpreter, successive requests can
make use of any cached data. As mentioned by Mike, this cached
data could be a database connection pool.

Graham


More information about the Mod_python mailing list