pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chen Huajun <chenhj@cn.fujitsu.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: kaprikorn07 <bharath.spyk@gmail.com>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: performance problem of Failover Datasource?
Date: Sat, 15 Dec 2012 15:10:49 +0800
Message-ID: <50CC2279.3090301@cn.fujitsu.com> (raw)
In-Reply-To: <50CB29BD.6090903@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>
	<CADK3HH+TLPjrrJ=cQWqZ+0B5o96xR+sTVcvqhcDU4CjyryKG2g@mail.gmail.com>
	<50CA959E.4060603@cn.fujitsu.com>
	<50CB29BD.6090903@cn.fujitsu.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>

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



view thread (13+ messages)  latest in thread

Message-ID: <50CC2279.3090301@cn.fujitsu.com>
Permalink:  ../50CC2279.3090301@cn.fujitsu.com/
Also on:    postgresql.org/message-id/50CC2279.3090301@cn.fujitsu.com

 · 

reply

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, pg@fastcrypt.com, bharath.spyk@gmail.com
  Subject: Re: performance problem of Failover Datasource?
  In-Reply-To: <50CC2279.3090301@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> <CADK3HH+TLPjrrJ=cQWqZ+0B5o96xR+sTVcvqhcDU4CjyryKG2g@mail.gmail.com> <50CA959E.4060603@cn.fujitsu.com> <50CB29BD.6090903@cn.fujitsu.com> <50CC2279.3090301@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