Reputation: 3745
We've been reading the MongoDB driver documentation for v2.4 (yes, we're on a REALLY OLD version of MongoDB right now):
https://docs.mongodb.com/v2.4/reference/connection-string/
While we understand that maxPoolSize allows you to configure the maximum number of connections in the pool, we're wondering HOW that pool is managed.
Specifically, are the connections pre-allocated for each client that connects? With a default of 100 for maxPoolSize, does that mean each client causes a pool of 100 connections to be created on the server? Or are the connections in the pool created as needed, up to that maximum?
Pointers to any tutorials or best practices documentation on this topic would be appreciated, thanks!
Upvotes: 0
Views: 4803
Reputation: 996
Connection pool size is not about user, it is about request. If you do 100 requests in parallel to db they use all your connection pool. Roughly said one user can use all connection pool if run 100 parallel threads which interract with db.
Upvotes: 2