connection pooling

David <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
What specific benefit does an within-process connection pool provide
to a system?

Psycopg2 is threadsafe to the cursor level, (threadsafety=2) so a
process can create a global connection that is shared by all threads;
each thread can get a new cursor for its own purposes, and all threads
in the process can benefit from one persistant connection.  That would
seem to provide all the benefits of connection pooling, without the
overhead of checking connections into and out-of  a pool.

If there were multiple databases, needing different connections with
different authentication, then a connection pool would make sense, but
the Psycopg2 pool implementation (for example) does not seem to track
the connections by user, nor does it accomodate different
authentication data for different connections.

Am I overlooking something important in terms of what benefit
connection pooling provides, as opposed to simply sharing connections?

Is there a bandwidth issue, in that multiple connections create more
bandwidth to the pg server?

Is connection pooling one of those tools where you just know you need
it when you need it?

David

-- 
dkeeney-P535SsTe1EyzqXzpeo/[email protected]
Pitcher's Duel -> pitchersduel.python-hosting.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.