Re: Sthange things happen: SkyTools pgbouncer is NOT a balancer

Поиск
Список
Период
Сортировка
От Ivan Zolotukhin
Тема Re: Sthange things happen: SkyTools pgbouncer is NOT a balancer
Дата
Msg-id 751e56400709111026n5cdf8fd4v2d107a7c3a588a6d@mail.gmail.com
обсуждение исходный текст
Ответ на Sthange things happen: SkyTools pgbouncer is NOT a balancer  ("Dmitry Koterov" <dmitry@koterov.ru>)
Список pgsql-general
AFAIK PgBouncer is not a balancer but a connection pooler. Skype said
nothing about load balancing in its docs, so they are fair in this
sense. Why did you decide it should balance the load?

Regards,
 Ivan

On 9/11/07, Dmitry Koterov <dmitry@koterov.ru> wrote:
> Hello.
>
> We discovered some time ago that pgbouncer is NOT a balancer, because it
> cannot spread connections/queries to the same database to multiple servers.
> It's unbeliveable, but it's a fact! So, database name in the config MUST be
> unique.
>
> E.g. if we write
>
> bardb = host=192.168.0.1 dbname=bardb
> bardb = host=192.168.0.2 dbname=bardb
>  bardb = host=192.168.0.3 dbname=bardb
>
> in the config, pgbouncer always uses the first connection, and others are
> ignored. Here is the part of the source code:
>
> == loader.c:
>  void parse_database(char *name, char *connstr) {
>   ...
>   db = add_database(name);
>   ...
> }
>
> == objects.c:
> PgDatabase *add_database(const char *name)
> {
>     PgDatabase *db = find_database(name);
>      /* create new object if needed */
>     if (db == NULL) {
>         db = zmalloc(sizeof(*db));
>         ...
>     }
>     return db;
> }
>
> In these functions "name" is a key from the config ("bardb" in our example).
> We see that it's useless to create duplicate keys in config elements in
> [databases] sections, because only the first one is accepted.
>
>  So, it's completely magical for me why "Session pooling", "Transaction
> pooling" and "Statement pooling" options are exist (see
> https://developer.skype.com/SkypeGarage/DbProjects/PgBouncer).
> If pgbouncer is not a balancer, what purpose is to use "Statement pooling" -
> if we sent 100 queries (e.g.) in the same connection, they will always be
> directed to the SAME MACHINE in its different connections, no balancing
> optimization at all.
>
>

В списке pgsql-general по дате отправления:

Предыдущее
От: "George Pavlov"
Дата:
Сообщение: Re: Question about a query with two count fields
Следующее
От: "Marko Kreen"
Дата:
Сообщение: Re: Sthange things happen: SkyTools pgbouncer is NOT a balancer