swaldman / c3p0

a mature, highly concurrent JDBC Connection pooling library, with support for caching and reuse of PreparedStatements.
http://www.mchange.com/projects/c3p0
Other
1.28k stars 338 forks source link

How c3p0 manage connections in slaves? #146

Open yiwong2001 opened 4 years ago

yiwong2001 commented 4 years ago

Hi there,

I need help to understand how c3p0 works with rds cluster.

I have one web connects to RDS mysql. The RDS stack contains 1 master and 5 slaves. Each of nodes there can handle max to 1000 connections.

I configured min and max connections in c3p0 pool to 800.

Here is the confusion part. It looks like 800 connections are established on each of mysql nodes. As a result it could be 800*6 connections. Does it mean c3p0 established all 4800 connections, or it only hold 800 connections as set but shared by all data nodes? How c3p0 establish and manage connections in pool there?

Thanks