Re: [PoC] load balancing in libpq

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Satoshi Nagayasu <snaga(at)uptime(dot)jp>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PoC] load balancing in libpq
Date: 2012-09-24 21:52:46
Message-ID: CA+U5nM+HV6BtSyQoNrSDhba6Ns2Pqn+Js7sviSAFRH2T-yR8Yw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 23 September 2012 05:50, Satoshi Nagayasu <snaga(at)uptime(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2012-09-24 22:36:16 Re: pg_reorg in core?
Previous Message Boszormenyi Zoltan 2012-09-24 21:30:41 Re: [PATCH] lock_timeout and common SIGALRM framework