Thank you for confirming Adam.
Connections do not necessarily work in this manner with specific regards to MongoDB and connection count. The following example is not exactly the same but may shed some more light onto this. In this example, I have a particular cluster which I connect to with mongosh
from a single “server”. I connect with minPoolSize
value of 500
. After connecting successfully, we can see the connections increase by ~500 without even running a single operation from the mongosh
connection:
In this example, I have a “single server” (or single client) connecting to my MongoDB replica set yet it alone has increased the connection count by ~500 without performing any operations.
So given that information, what would you suggest should be my next step?
Note that since this is a shared instance, what you’re seeing here may not reflect what you’ll see in a dedicated instance, and thus what normally happens in a dedicated instance may not apply in this case. There are certain limitations of shared instances, thus it may not fit all use cases. Anecdotally, I have seen M0 clusters connection count having a delay to reflect the actual connection into the servers, so it’s possible that if your CI system have multiple connect/disconnect routines, M0’s connection counting lagged behind and thus do not reflect the true connection count. This discrepancy adds up, and thus you’re seeing the warning.
With regards to your particular set up, you may wish to investigate how the CI/CD system(s) are connecting to the MongoDB instance. As mentioned previously, there also may be slight variation in each of the driver(s) and how they handle connections to the MongoDB instance(s). The root cause may be as simple as connections not being closed properly.
Regards,
Jason