Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tj6GU-0003R9-Jf for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Dec 2012 10:43:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tj6GT-0001MB-Ex for pgsql-jdbc@arkaria.postgresql.org; Thu, 13 Dec 2012 10:43:41 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tj6GS-0001M5-HK for pgsql-jdbc@postgresql.org; Thu, 13 Dec 2012 10:43:40 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tj6GP-0006H5-Ht for pgsql-jdbc@postgresql.org; Thu, 13 Dec 2012 10:43:38 +0000 X-IronPort-AV: E=Sophos;i="4.84,273,1355068800"; d="scan'208";a="6391098" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 13 Dec 2012 18:41:36 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id qBDAhVpo024777; Thu, 13 Dec 2012 18:43:31 +0800 Received: from [10.167.159.99] ([10.167.159.99]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012121318423626-402464 ; Thu, 13 Dec 2012 18:42:36 +0800 Message-ID: <50C9B102.2060208@cn.fujitsu.com> Date: Thu, 13 Dec 2012 18:42:10 +0800 From: Chen Huajun User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.2.28) Gecko/20120306 Lightning/1.0b2 Thunderbird/3.1.20 MIME-Version: 1.0 To: kaprikorn07 CC: pgsql-jdbc@postgresql.org Subject: Re: performance problem of Failover Datasource? References: <4DFA5A86.9030301@acm.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> In-Reply-To: <1355303340886-5736270.post@n5.nabble.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/13 18:42:36, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/13 18:42:36 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 222.73.24.84 (failed) X-Pg-Spam-Score: -1.5 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Hi All, In the latest jdbc driver,multi backends can be assigned in the URL as foll= owing. >With latest jdbc drivers you can simply configure multiple host:port pair= s 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 ope= ned the hosts are tried in round-robin until a connection is successfully e= stablished. 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 f= irst host, swap the target host and the first host. And then subsequent connecting will try the most suitable host at first. --=20 Best Regards=EF=BC=8C 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. > > --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc