-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.10.3
-
Component/s: Connectivity
-
None
-
Environment:c# driver in Azure VM hosting Service Fabric Cluster
We have a proces where all our tenant databases are processed. In our setup each tenant has it's own database (with own credentials).
Currently we use the default of the c# driver (connection pool of 100). What i'm seeing is that the number of connections to our MongoBD server is only increasing.
It looks like the driver is not reusing used connections from the pool.
I use the following script
db.currentOp(true).inprog.reduce(
{{ (accumulator, connection) => {}}
{{ ipaddress = connection.client ? connection.client.split(":")[0] : "Internal";}}
{{ ipaddressActiveConnection = ipaddress + "-active";}}
{{ ipaddressINActiveConnection = ipaddress + "-INactive"; }}
{{ accumulator[ipaddress] = (accumulator[ipaddress] || 0) + 1;}}
{{ accumulator["TOTAL_CONNECTION_COUNT"]++;}}
{{ if (connection.active) { }}
{{ accumulator[ipaddressActiveConnection] = (accumulator[ipaddressActiveConnection] || 0) + 1;}}
{{ accumulator["ACTIVE_CONNECTION_COUNT"]++;}}
{{ } else {}}
{{ accumulator[ipaddressINActiveConnection] = (accumulator[ipaddressINActiveConnection] || 0) + 1;}}
{{ accumulator["INACTIVE_CONNECTION_COUNT"]++;}}
{{ }}}
{{ return accumulator;}}
{{ },}}
{{ { TOTAL_CONNECTION_COUNT: 0, ACTIVE_CONNECTION_COUNT : 0, INACTIVE_CONNECTION_COUNT : 0 }}}
)
When running i see that the number of INACTIVE_CONNECTIONS is increasing.
and a little later
Is this normal, cause it feels like a bug, where a new connection (from pool) is created instead of reusing an inactive one.