I increased MaxPoolSize
value to 3000. does this mean that there are 3000 concurrent connections allowed using this instance, or it counts any other connections through other object instances too?
var connectionString = "mongodb://username:password@ip:27017/MyDB?maxPoolSize=3000"
var client = new MongoClient(connectionString);
return client.GetDatabase(databaseName);
Well, it's not exactly as you said. This article provides a brief explaination of how connection pooling works is and it basically states that:
Most MongoDB drivers support a parameter that sets the max number of connections (pool size) available to your application. The connection pool size can be thought of as the max number of concurrent requests that your driver can service. The default pool size varies from driver to driver, e.g. for Node it is 5, whereas for Python it is 100. If you anticipate your application receiving many concurrent or long-running requests, we recommend increasing your pool size- adjust accordingly!
The total incoming connection limit on the server is determined by the lesser of the limits imposed by the operating system or maxIncomingConnections (or maxConns in MongoDB 2.4 and earlier).
Actually, the difference between the two settings is as follows:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With