-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.0
-
Component/s: Connectivity
-
Environment:ASP.NET MVC 5 with Mongo on Windows Server 2012 (test server)
What's the best practice for ensuring that the connection pool works properly with version 2.0 and async requests. I have a prototype application built using the new driver that creates a new MongoClient object on each request. The app is not using a connection string, rather it is building a MongoClientSettings object and using that when creating the MongoClient. Under load, my app creates an enormous number of connections to Mongo causing me to have to increase the maximum pool size and, as a result, it uses too many resources and bogs down fairly quickly.
Does the new driver use the same pool if I create a new MongoClient with the same settings set on the constructor or does it use a separate pool for each MongoClient object? I am trying to determine if I need to store the connection at the application level vs. per request (which normally I would do anyway) or if the problem is related to the async processes.
- is related to
-
CSHARP-1293 Add support for shutting down a MongoClient that is no longer useful.
- Closed