Re: [PoC] load balancing in libpq

From: Satoshi Nagayasu <snaga(at)uptime(dot)jp>
To: Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Euler Taveira <euler(at)timbira(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PoC] load balancing in libpq
Date: 2012-09-24 18:29:25
Message-ID: 5060A685.4050202@uptime.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2012/09/24 1:07, Christopher Browne wrote:
> 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.

Thanks for the comment.

As you pointed out, I think it would be a start point to
implement new simple load-balancing stuff. That's what
I actually intended.

My clients often ask me easier way to take advantage of
replication and load-balancing.

I know there are several considerations to be discussed,
such as API compatibility issue, but it would be worth
having in the core (or around the core).

And I also know many people are struggling with load-balancing
and master-failover things for the PostgreSQL replication.

If those people are trying implementing their own load-balancing
stuff in their apps again and again, it's time to consider
implementing it to deliver and/or leverage with the potential
of PostgreSQL replication.

Regards,

>
> On 2012-09-23 10:01 AM, "Euler Taveira" <euler(at)timbira(dot)com
> <mailto: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
> <mailto:pgsql-hackers(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Satoshi Nagayasu <snaga(at)uptime(dot)jp>
Uptime Technologies, LLC. http://www.uptime.jp

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2012-09-24 18:38:13 Re: pg_reorg in core?
Previous Message Fujii Masao 2012-09-24 18:06:06 Re: XLogInsert scaling, revisited