Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjLUJ-0000qy-BV for pgsql-jdbc@arkaria.postgresql.org; Fri, 14 Dec 2012 02:58:59 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TjLUI-0001OM-9g for pgsql-jdbc@arkaria.postgresql.org; Fri, 14 Dec 2012 02:58:58 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjLUH-0001OG-7A for pgsql-jdbc@postgresql.org; Fri, 14 Dec 2012 02:58:57 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TjLUE-0003LH-44 for pgsql-jdbc@postgresql.org; Fri, 14 Dec 2012 02:58:55 +0000 X-IronPort-AV: E=Sophos;i="4.84,278,1355068800"; d="scan'208";a="6394742" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 14 Dec 2012 10:56:59 +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 qBE2xNX8013296; Fri, 14 Dec 2012 10:59:23 +0800 Received: from [127.0.0.1] ([10.167.159.99]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2012121410575839-416326 ; Fri, 14 Dec 2012 10:57:58 +0800 Message-ID: <50CA959E.4060603@cn.fujitsu.com> Date: Fri, 14 Dec 2012 10:57:34 +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: Dave Cramer CC: kaprikorn07 , List 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> <50C9B102.2060208@cn.fujitsu.com> In-Reply-To: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/14 10:57:58, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/14 10:57:58 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 > Feel free to send us a patch. OK,I will make the patch soon. --=20 Best Regards, Chen Huajun (2012/12/14 5:01), Dave Cramer wrote: > Feel free to send us a patch. > > Dave > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > > On Thu, Dec 13, 2012 at 6:42 AM, Chen Huajun > wrote: > > Hi All, > > > In the latest jdbc driver,multi backends can be assigned in the URL a= s following. > > >With latest jdbc drivers you can simply configure multiple host:por= t 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 successf= ully 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 fir= st. > > > -- > 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. nabbl= e.com/Re-Failover- Datasource-tp4496411p5736270. html > > Sent from the PostgreSQL - jdbc mailing list archive at Nabble.co= m. > > > > > > > -- > Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org ) > To make changes to your subscription: > http://www.postgresql.org/ mailpref/pgsql-jdbc > > --=20 Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc