From: Chen Huajun <chenhj@cn.fujitsu.com>
To: kaprikorn07 <bharath.spyk@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: performance problem of Failover Datasource?
Date: Thu, 13 Dec 2012 18:42:10 +0800
Message-ID: <50C9B102.2060208@cn.fujitsu.com> (raw)
In-Reply-To: <1355303340886-5736270.post@n5.nabble.com>
References: <4DFA5A86.9030301@acm.org>
<itdn5g$eu7$1@dough.gmane.org>
<4DFA671F.2050005@acm.org>
<4DFA9704.4000209@hogranch.com>
<4DFAB403.5010309@acm.org>
<4DFAB5B8.5010603@hogranch.com>
<4DFAB9E2.4070905@acm.org>
<1334056170219-5629626.post@n5.nabble.com>
<1355303340886-5736270.post@n5.nabble.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Hi All,
In the latest jdbc driver,multi backends can be assigned in the URL as following.
>With latest jdbc drivers you can simply configure multiple host:port pairs in the url separated by comma:
>jdbc:postgresql://host1:port1,host2:port2/test
>It has only the most basic failover support. When a new connection is opened the hosts are tried in round-robin until a connection is successfully established.
But there is a performance problem .if the first host is down,
all connecting must be blocked until connect timeout at first,
and then try connect to the next host.
Why not adjust the order of hosts dynamically?
For excample, after a successful connecting,if the target host is not the first host,
swap the target host and the first host.
And then subsequent connecting will try the most suitable host at first.
--
Best Regards,
Chen Huajun
(2012/12/12 17:09), kaprikorn07 wrote:
> Hi All,
>
> As Bruce Adams has mentioned, please let me know if there is any other way
> to do it other than pgBouncer and pgPool.
>
> Please help!
>
>
>
> --
> View this message in context: http://postgresql.1045698.n5.nabble.com/Re-Failover-Datasource-tp4496411p5736270.html
> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>
>
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: chenhj@cn.fujitsu.com, bharath.spyk@gmail.com
Subject: Re: performance problem of Failover Datasource?
In-Reply-To: <50C9B102.2060208@cn.fujitsu.com>
References: <4DFA5A86.9030301@acm.org> <itdn5g$eu7$1@dough.gmane.org> <4DFA671F.2050005@acm.org> <4DFA9704.4000209@hogranch.com> <4DFAB403.5010309@acm.org> <4DFAB5B8.5010603@hogranch.com> <4DFAB9E2.4070905@acm.org> <1334056170219-5629626.post@n5.nabble.com> <1355303340886-5736270.post@n5.nabble.com> <50C9B102.2060208@cn.fujitsu.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox