[mod_python] pool and mps

Nicolas Lehuen nicolas.lehuen at gmail.com
Thu Jan 27 02:06:28 EST 2005


There is no standard way to do it. First, if you are using the Apache
mpm_prefork (the forked MPM), the efficiency of pooling will be very
low, since your pool will be instantiated as many times as there are
Apache processes.

I'm using the threaded MPM, and I built my own DB connection pool. The
best place to instantiate the DB connection pool is in a module on the
PYTHONPATH, which will be imported from any published modules. This
way, you are guaranteed that the pool will be instantiated only once.

As for the pool code, I'll publish it eventually... It's not really
difficult to write one, but threading and locking issues can be a
little tricky to get right.


On Thu, 27 Jan 2005 00:05:26 +0100, Rosendo Martinez
<rosendo.martinez at valdisme.com> wrote:
> Hi all,
> this is a mps(by Daniel Popowich) and/or mod_python question.
> How can i configurate a pool of db connections o a pool of objects?
> Thanks for your help.
> Rosendo.
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python

More information about the Mod_python mailing list