per-review of PgBouncer / Slony design - Mailing list pgsql-performance

From Mark Stosberg
Subject per-review of PgBouncer / Slony design
Date
Msg-id ftdttr$8n4$1@ger.gmane.org
Whole thread Raw
In response to Re: recommendations for web/db connection pooling or DBD::Gofer reviews  ("Joshua D. Drake" <jd@commandprompt.com>)
List pgsql-performance
> I would stick to proven postgresql technologies such as pgbouncer.

Thanks for the fast recommendation, Joshua.  I'll consider it.

Our application is Slony-replicated web/db project with two slaves.

Does this design seem sensible?

- Run one pgbouncer server on the master, with settings to
   service the master and both slaves.

- We already handle balancing traffic between the slaves separately, so
that can remain unchanged.

- Use Session Pooling both both the masters and the slaves. In theory,
the slaves should just be doing transaction-less SELECT statements, so a
more aggressive setting might be possible, but I believe there might be
a "leak" in the logic where we create a temporary table on the slave in
one case.

- Redirect all application connections through pgbouncer

###

 From graphs we keep, we can see that the slaves currently use a max of
about 64 connections...they are far from maxing out what's possible. So
I was trying to think through if made sense to bother using the
pgBouncer layer with them. I through of two potential reasons to still
use it:
  - In the event of a major traffic spike on the web servers, pgbouncer
would keep the number of db slots under control.
  - Potentially there's a performance gain in having PgBouncer hold the
connections open.

Does that analysis seem correct?

For the master's pool size, I thought I would just choose a number
that's a little larger that the daily max number of DB slots in use.

    Mark

pgsql-performance by date:

Previous
From: Florian Weimer
Date:
Subject: Re: Severe performance problems for simple query
Next
From: "Hell, Robert"
Date:
Subject: Re: Looking for bottleneck during load test