Re: [PoC] load balancing in libpq

From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Euler Taveira <euler(at)timbira(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Satoshi Nagayasu <snaga(at)uptime(dot)jp>
Subject: Re: [PoC] load balancing in libpq
Date: 2012-09-23 16:07:00
Message-ID: CAFNqd5UNgr=3kpsv2waF3MOeHPqZEJ_jXKe2w4-o6mo4d8BKBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We historically have connection pooling as an external thing; with the high
degree to which people keep implementing and reimplementing this, I think
*something* more than we have ought to be built in.

This, with perhaps better implementation, might be an apropos start.

Parallel with LDAP: it takes very much this approach, where configuration
typically offers a list of LDAP servers. I am not certain if OpenLDAP does
round robin on the list, or if it tries targets in order, stopping when it
succeeds. A decent debate fits in, there.

I could see this being implemented instead via something alongside
PGSERVICE; that already offers a well-defined way to capture a "registry"
of connection configuration. Specifying a list of service names would
allow the command line configuration to remain short and yet very flexible.
On 2012-09-23 10:01 AM, "Euler Taveira" <euler(at)timbira(dot)com> wrote:

> On 23-09-2012 07:50, Satoshi Nagayasu wrote:
> > I have just written the first PoC code to enable load balancing
> > in the libpq library.
> >
> Your POC is totally broken. Just to point out two problems: (i) semicolon
> (;)
> is a valid character for any option in the connection string and (ii) you
> didn't think about PQsetdb[Login](), PQconnectdbParams() and
> PQconnectStartParams(). If you want to pursue this idea, you should think a
> way to support same option multiple times (one idea is host1, host2, etc).
>
> Isn't it easier to add support on your application or polling software?
>
>
> --
> Euler Taveira de Oliveira - Timbira http://www.timbira.com.br/
> PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2012-09-23 16:14:38 Re: pg_reorg in core?
Previous Message Rural Hunter 2012-09-23 14:20:08 Re: [ADMIN] pg_upgrade from 9.1.3 to 9.2 failed