Re: [PoC] load balancing in libpq - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: [PoC] load balancing in libpq
Date
Msg-id CA+U5nM+HV6BtSyQoNrSDhba6Ns2Pqn+Js7sviSAFRH2T-yR8Yw@mail.gmail.com
Whole thread Raw
In response to [PoC] load balancing in libpq  (Satoshi Nagayasu <snaga@uptime.jp>)
List pgsql-hackers
On 23 September 2012 05:50, Satoshi Nagayasu <snaga@uptime.jp> wrote:

> I have just written the first PoC code to enable load balancing
> in the libpq library.
>
> This libpq enhancement is intended to allow PostgreSQL users to
> take advantage of the replication in easier way.
>
> With using this patch, PQconnectdb() function accepts multiple
> connection info strings, and pick one of them by round-robin basis
> to connect.

It's certainly worth thinking about. New ideas are good, if they have
some justification.

A load balancing solution that only works at connection level isn't
much of a solution, IMHO.

If you have multiple connection strings in the client program, its
trivial to put them in an array and pick one randomly, then use that.
So this is already available as a solution in user space.

Also, any client based solution presumes we can ship lists of cluster
metadata to clients, which we have no solution for, so it places a
much greater burden on the administrator. Load balancing config needs
to be held more centrally.

-- Simon Riggs                   http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Boszormenyi Zoltan
Date:
Subject: Re: [PATCH] lock_timeout and common SIGALRM framework
Next
From: Josh Berkus
Date:
Subject: Re: pg_reorg in core?