简体   繁体   中英

MongoDB connection pooling with the c# driver

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM