Re: Connection pooling for a mixture of lightweight and heavyweight jobs? - Mailing list pgsql-admin

From Kevin Grittner
Subject Re: Connection pooling for a mixture of lightweight and heavyweight jobs?
Date
Msg-id 4C52CE6F0200002500033F21@gw.wicourts.gov
Whole thread Raw
In response to Re: Connection pooling for a mixture of lightweight and heavyweight jobs?  (Craig James <craig_james@emolecules.com>)
List pgsql-admin
Craig James <craig_james@emolecules.com> wrote:

> I'm not clear on how connection pooling would help this problem.
> I would have 100 lightweight backends, whether they were pooled or
> not, always sitting around.

Not if you use a good pooler with the right configuration.  You
should have 10 to 20 database connections which the lightweight
query requests share.  You want something which will queue requests
above that maximum, and immediately release one more request when a
previous request completes.  We have this built in to our
application framework, so I'm not familiar with how to configure
pgbouncer or pgpool, but from what I've heard I would expect both of
these to support such behavior.

(Someone with more experience with one or both of these products,
please jump in here....)

At this point some people protest that they can't let requests queue
up like that because they need fast response time.  Trust me; if you
set up a good connection pool to the right size, this *will* give
you much better throughput *and* response time than letting the
thundering herd loose to compete for resources.

-Kevin

pgsql-admin by date:

Previous
From: Craig James
Date:
Subject: Re: Connection pooling for a mixture of lightweight and heavyweight jobs?
Next
From: "Gnanakumar"
Date:
Subject: Unexpected disk space growth controlling measures