Re: Why would I want to use connection pooling middleware?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kirk Strauser <kirk(at)strauser(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why would I want to use connection pooling middleware?
Date: 2009-01-15 16:08:41
Message-ID: 6607.1232035721@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kirk Strauser <kirk(at)strauser(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-01-15 16:13:16 Re: Why would I want to use connection pooling middleware?
Previous Message Kirk Strauser 2009-01-15 15:54:50 Why would I want to use connection pooling middleware?