Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjlv5-0000W5-15 for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Dec 2012 07:12:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tjlv3-0001NM-UK for pgsql-jdbc@arkaria.postgresql.org; Sat, 15 Dec 2012 07:12:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjlv3-0001NH-Ca for pgsql-jdbc@postgresql.org; Sat, 15 Dec 2012 07:12:21 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tjluy-00068p-Rb for pgsql-jdbc@postgresql.org; Sat, 15 Dec 2012 07:12:19 +0000 X-IronPort-AV: E=Sophos;i="4.84,288,1355068800"; d="scan'208";a="6403683" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 15 Dec 2012 15:10:20 +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 qBF7Ckp9027132; Sat, 15 Dec 2012 15:12:47 +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 2012121515111830-437764 ; Sat, 15 Dec 2012 15:11:18 +0800 Message-ID: <50CC2279.3090301@cn.fujitsu.com> Date: Sat, 15 Dec 2012 15:10:49 +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> <50CA959E.4060603@cn.fujitsu.com> <50CB29BD.6090903@cn.fujitsu.com> In-Reply-To: <50CB29BD.6090903@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/15 15:11:18, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/12/15 15:11:18, Serialize complete at 2012/12/15 15:11:18 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8; format=flowed X-Host-Lookup-Failed: Reverse DNS lookup failed for 222.73.24.84 (failed) X-Pg-Spam-Score: -2.6 (--) 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 In this patch,I use Collections.synchronizedSet to synchronize within multi-threads. But i worry about locking operation is a litter frequent by Collections.synchronizedSet and may affect performance. I think using keword "synchronized" explicitly instead of Collections.synchronizedSet may reduce times of locking.Is there any better suggestion? In addition, I have a idea. By adjusting the order of hosts we also can implement a simple load balance while all of the hosts are master or read only slave. For example: Basically pick up the server randomly.If one server had dead remove it from the candidates, and retry the next server. And after a while(can be configured) re-add the dead host to the candidates because the dead server may had been repaired. What about that? (2012/12/14 21:29), Chen Huajun wrote: > Hi > > I had make the patch,Please check it. > > and I had run the testcases,the result is same as before modified. > > > > > -- Best Regards, Chen Huajun -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc