c3p0
c3p0 copied to clipboard
How is maxpoolsize
Hi there, I am using hibernate, with amazon rds for read/write splitting up. I have configuration as following:
<bean id="widgetDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<property name="driverClass" value="com.mysql.jdbc.ReplicationDriver"/>
<property name="jdbcUrl" value="jdbc:mysql://master-private:3306,slave1-private:3306,slave2-private:3306/db?autoReconnect=true&failOverReadOnly=false&roundRobinLoadBalance=true&characterEncoding=utf8"/>
<property name="maxPoolSize" value="1000"/>
I wonder how c3p0 connection pool establish connections with master/slaves. will it keep 1k on each servers? Or total connections on all servers would be 1k?
thanks!
there would be a maximum of 1000 Connections on the client, so total to all servers would be max 1000.
smiles, steve
thanks Swaldman,
How will c3p0 decide connections on each of servers? will it like 333 on each if maxsize is 1000? Our application is quite read heavy. Is any way to set more height on slaves (read servers).
hi @yiwong2001 first of all, there is max connection size limitation at server side, saying 1000. with this value in mind, the total number of clients connections (aka, the sum of the connections on all the clients) should not exceed 1000, saying you have 4 client, then each should not exceed 250.