-
Type: Bug
-
Resolution: Unresolved
-
Priority: Unknown
-
None
-
Affects Version/s: 6.10.0
-
Component/s: None
-
3
-
(copied to CRM)
Use Case
We're using mongodb's official clients with three different scenarios:
- Parse Server
- Mongoose
- Vanilla MongoDB driver
We're consistently observing increasing idle connections at the server side. The `currentOp` shows increasing connections that is `active: false`. After a long-time running, the services will finally run out of connections, and some DB queries will stuck forever
After digging the source code, we successfully stablised idle connection number by combining `minPoolSize` and `maxIdleTimeoutMS`. The first option triggers a full sweep every 100ms, and the later one will help the sweep logic to clean up stale connection.
So based on these observations, we're pretty sure that there's a leakage in the client code. It seems that the client can't utilize all idle connections in the pool, and gradually release more and more idle connections to the pool. Since it can't utilize the idle connections, when the pool is full of idle connections, it stucks for some db queries.
Screenshots
The server connections number before and after `minPoolSize&maxIdleTimeoutMS`, the connections will reach the pool limit gradually:
- is fixed by
-
NODE-6589 Background task should clean up perished connections even when minPoolSize = 0
- Needs Triage