Re: Proposal: Implement failover on libpq connect level.

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: vitus(at)wagner(dot)pp(dot)ru
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: Implement failover on libpq connect level.
Date: 2015-08-19 15:17:35
Message-ID: 20150820.001735.1312191060652873768.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

> Here we are discussing load-balancing on the client level, not on the
> statement level.

I see.

> Suppose that we have 100 readonly clients and 3 standby servers + master.
> If all clients specify all four servers in the their connect strings,
> and connect randomly to them, each server would have approximately 25
> clients.
>
> But once connection is established, each client works with one
> server (at least until communication failure occurs and it would call
> PQreset. In this case it has to reprepare statements anyway).

One downside of this is, if one of the standby servers is not
responding, every time clients will be blocked by the server before
giving up the connection trial. This could last for hours (for
example, the network cable is plugged out). I think round robin DNS is
better because the DNS server will drop the entry corresponding broken
server (or any solution which has similar capability). After all, this
type of client side solutions are not very stable in a real world
environment IMO (I heard the same opinion regarding HAProxy).

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-08-19 15:21:01 Re: Make HeapTupleSatisfiesMVCC more concurrent
Previous Message Kevin Grittner 2015-08-19 15:15:47 Re: Bug? ExecChooseHashTableSize() got assertion failed with crazy number of rows

Browse pgsql-jdbc by date

  From Date Subject
Next Message Shulgin, Oleksandr 2015-08-19 15:25:07 Re: Proposal: Implement failover on libpq connect level.
Previous Message ''Victor Wagner *EXTERN*' *EXTERN*' *EXTERN* 2015-08-19 14:45:26 Re: Proposal: Implement failover on libpq connect level.