Re: performance problem of Failover Datasource?

From: Chen Huajun <chenhj(at)cn(dot)fujitsu(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: kaprikorn07 <bharath(dot)spyk(at)gmail(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: performance problem of Failover Datasource?
Date: 2012-12-15 07:10:49
Message-ID: 50CC2279.3090301@cn.fujitsu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Harrington 2012-12-15 16:19:07 Re: performance problem of Failover Datasource?
Previous Message dmp 2012-12-14 17:23:32 Re: Fwd: [ADMIN] Confuse about the behaveior of PreparedStatement.executeBatch (jdbc)