[mod_python] Lifespan of objects

Svenne Krap svenne at krap.dk
Fri Aug 20 00:16:16 EDT 2004

Nic Ferrier wrote:

>Are you just hitting some MySQL cursor limit? You are using a single
>connection in parallel, not a good idea.
>I'd say you need to use a connection pool and get and return a
>connection from the pool with every request.
>Mod_python mailing list
>Mod_python at modpython.org
I don't realize how I am using a single connection in parallel.

While running apache, it forks new processes if there are simultanious 
connections. Each of these should open exactly one connection and use that.

I thought, that my example was a simple connection pool (I never need 
more than one cursor open per process anyhow), if I am in error, please 
provide pointers to a good connection pool (I haven't been able to 
locate any through google. Just a mailing-list suggestion that resembles 
my solution).

It seems however, when I modify the .py-file the amount of connections 
grow. Is my program "losing" connections when the module is reloaded ?

Thanks in advance.


More information about the Mod_python mailing list