loadBalanceHosts and weighted server selection - Mailing list pgsql-jdbc

From Michael Charnoky
Subject loadBalanceHosts and weighted server selection
Date
Msg-id CAEWrP=k88RCdQoCkLZ7-NOf4_UvMRq5dAinPqjQ=R4DoOsG88A@mail.gmail.com
Whole thread Raw
List pgsql-jdbc
Hi, we'd like to take advantage of the "loadBalanceHosts" feature of the jdbc driver. The only hitch is that we'd like to have the driver prefer one host over the other based on some sort of "weight". Ideally the driver would choose hostA 2/3 of the time and the hostB 1/3 of the time (all queries are read-only). Can we achieve this by specifying hostA twice in the jdbc url? For example, would this work?

jdbc:postgresql://hostA,hostA,hostB/dbname?loadBalanceHosts=true

Thanks,
noky

pgsql-jdbc by date:

Previous
From: Martin Pärtel
Date:
Subject: Re: Clarification on thread-safety
Next
From: Dave Cramer
Date:
Subject: Re: Clarification on thread-safety