Hi - Im running a single mongod in a docker container and every couple of weeks Im no longer available to connect to the server using python/mongo or compass all with the error:
com.mongodb.MongoQueryException: Query failed with error code 261 and error message ‘Unable to add session into the cache because the number of active sessions is too high’ on server *******:27017
we just upgraded which was when this started. Our drivers are quite old, but we operate a large mongo estate so we have various contraints on what can be changed.
This issue is related to the fact that you have reached a 1000000 allowed default open sessions and for some reason they are not getting purged (maxSessions parameter).
There is probably a session leak as a result of a bug or incompatibility of the driver and the server.
Please upgrade to latest compatible drivers and see if after a bounce of the cluster the issue persists.