[mod_python] MySQLDb or SQLObject connection pooling snippetw anted

Sells, Fred fred at adventistcare.org
Thu Oct 12 10:15:42 EDT 2006

You convinced me, I'm not enough of an Apache expert (yet) to start dealing
with forking/threads/etc.

most of our web stuff does not require the speed, given the level of effort
and the risk (of screwing up).

From: Joshua "Jag" Ginsberg wrote...

You're going to have difficulty with implementing a pure db connection
pooling solution simply b/c Apache is a forking webserver -- you can't
pass SQL connection objects between processes. If you're doing only one
thread per process, you can simply implement a connection object as a
Singleton class -- then it will get destroyed as the process gets
recycled. If you're doing multiple threads per process, you're going to
have to be a bit more clever.

I know it's sexy as hell to do connection pooling, but is DB connection
overhead really such a bottleneck for you? Folks who absolutely,
positively need the benefits of a shared-memory, multi-threaded,
thread-safe webserver usually pick something like AOLServer ("AOLServer
-- Heehee! It tickles!" -- sorry, bad joke).


On Thu, 2006-10-12 at 08:55 -0400, Sells, Fred wrote:
> Currently using mod_python 3.1.x and Apache 2.x.  Could upgrade mod_python
> if we must, but this is what apt-get gives us.
> I would like to implement connection pooling for the MySQL database.
> on the application requirements, we vary between MySQLDb and SQLObject.
> The only reference I've found so far is jonpy.sourceforge.net Does anyone
> have any "better" modules or any experience with this one?
> The information contained in this message may be privileged and / or
> confidential and protected from disclosure. If the reader of this message
> not the intended recipient, you are hereby notified that any
> distribution or copying of this communication is strictly prohibited. If
> have received this communication in error, please notify the sender
> immediately by replying to this message and deleting the material from any
> computer.
> _______________________________________________
> 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