[Zope-dev] DB connection pooling
Erik Stephens
samurai@ep.newtimes.com
Fri, 02 Mar 2001 16:39:50 -0700
Hello all,
I've been working on an implementation of connection pooling for the
MySQLDA. Basically, Zope connections will be pooled by connection
string to reduce the number of unecessary connections to MySQL. The
number of connections will be reduced in 2 respects: 1) Multiple
threads will share the connection pool and 2) Zope connection objects
that use the same connection will be pooled. A slight bit of run-time
overhead will be introduced from having to look up connection objects by
connection string, but the trade-off will be well worth it, at least for
our setup.
Correct me if I'm wrong, but without pooling, the number of connections
that could be created is: <num Zope servers> * <num Zope threads> * <num
connection objects>. With pooling, this number becomes: <num Zope
servers> * <num distinct connection strings> * X. X can range from 1 to
<num Zope threads>, depending on how high load is.
Question to y'all is this: Is this a worthwhile endeavor? Would others
find this useful? Or are we just weird?
The new release of the postgresql dba announce today mentioned
"automatic management of multiple phisical connections to the DB (one
per thread) to speed up queries". Is this connection pooling in some
form?
Thanks,
Erik