Обсуждение: PGbouncer and batch vs real-time pools

Поиск
Список
Период
Сортировка

PGbouncer and batch vs real-time pools

От
François Beausoleil
Дата:
Hello all,

From reading the PGbouncer configuration man page, PGbouncer creates a new pool on every DB + user pair. If I have two
typesof queries, long-lived batch reporting and fast PK lookups, then I should favor two pools. Both pools can hit the
samedatabase server. 

I can configure pgbouncer like this:

[databases]
batch = host=127.0.0.1 port=5432 user=batch dbname=app pool_size=M
quick = host=127.0.0.1 port=5432 user=quick dbname=app pool_size=N

I believe the important user is the one pgbouncer uses to connect to the real PostgreSQL server. That user + dbname is
whatcreates a new pool. The client's name (the one the app connects as) is irrelevant since I hard-code what user I
wantto use. 

Did I read the configuration manual right? Any advice from people "familiar with the matter"?

Thanks!
François Beausoleil




Re: PGbouncer and batch vs real-time pools

От
Sergey Konoplev
Дата:
On Thu, Feb 14, 2013 at 9:09 AM, Fran=E7ois Beausoleil
<francois@teksol.info> wrote:
> I believe the important user is the one pgbouncer uses to connect to the =
real PostgreSQL server. That user + dbname is what creates a new pool. The =
client's name (the one the app connects as) is irrelevant since I hard-code=
 what user I want to use.
>
> Did I read the configuration manual right? Any advice from people "famili=
ar with the matter"?

Yes, you understand it right. It all the connections between pgbouncer
and postgres will be done with the user you specified in the
configuration file does not mater what user you used to connect to
pgbouncer from your application. And yes it means that you will have
these two pools only.

--=20
Sergey Konoplev
Database and Software Architect
http://www.linkedin.com/in/grayhemp

Phones:
USA +1 415 867 9984
Russia, Moscow +7 901 903 0499
Russia, Krasnodar +7 988 888 1979

Skype: gray-hemp
Jabber: gray.ru@gmail.com