Re: Why would I want to use connection pooling middleware? - Mailing list pgsql-general

From Tom Lane
Subject Re: Why would I want to use connection pooling middleware?
Date
Msg-id 6607.1232035721@sss.pgh.pa.us
Whole thread Raw
In response to Why would I want to use connection pooling middleware?  (Kirk Strauser <kirk@strauser.com>)
Responses Re: Why would I want to use connection pooling middleware?  (Alvaro Herrera <alvherre@commandprompt.com>)
Re: Why would I want to use connection pooling middleware?  (Kirk Strauser <kirk@strauser.com>)
List pgsql-general
Kirk Strauser <kirk@strauser.com> writes:
> I have a PostgreSQL 8.3.5 server with max_connections = 400.  At this
> moment, I have 223 open connections, including 64 from a bunch of
> webserver processes and about 100 from desktop machines running a
> particular application.  The rest are from various scheduled processes
> and other assorted things.  Now, I know there are projects like pgpool-
> II that can serve to pool connections to the server.  Why would I want
> to do that, though?

Idle backends eat resources that would be better spent elsewhere.
(I'm assuming that the majority of those 223 backends aren't actually
doing anything at any one instant.)  As an example, any system catalog
update has to be broadcast to all live backends, and they all have to
dutifully search their catalog caches to flush stale entries.  That costs
the same whether the backend is being put to use or has been sitting
idle for minutes.

There's no percentage in trying to pool connections from applications
that are constantly doing something; but webserver sessions tend to have
lots of user "think time" as well as similar DB environments, so often
they can be pooled profitably.

            regards, tom lane

pgsql-general by date:

Previous
From: Kirk Strauser
Date:
Subject: Why would I want to use connection pooling middleware?
Next
From: Alvaro Herrera
Date:
Subject: Re: Why would I want to use connection pooling middleware?