From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: Craig James <craig_james@emolecules.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Connection pooling for a mixture of lightweight and heavyweight jobs?
Date: Fri, 30 Jul 2010 13:06:55 -0500
Message-ID: <4C52CE6F0200002500033F21@gw.wicourts.gov> (raw)
In-Reply-To: <4C5310C4.1040906@emolecules.com>
References: <4C50ABA5.5010408@emolecules.com>
<4C52B0240200002500033F10@gw.wicourts.gov>
<4C530758.7050804@emolecules.com>
<4C52C7790200002500033F1C@gw.wicourts.gov>
<4C5310C4.1040906@emolecules.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, craig_james@emolecules.com
Subject: Re: Connection pooling for a mixture of lightweight and heavyweight jobs?
In-Reply-To: <4C52CE6F0200002500033F21@gw.wicourts.gov>
References: <4C50ABA5.5010408@emolecules.com> <4C52B0240200002500033F10@gw.wicourts.gov> <4C530758.7050804@emolecules.com> <4C52C7790200002500033F1C@gw.wicourts.gov> <4C5310C4.1040906@emolecules.com> <4C52CE6F0200002500033F21@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox