According to the documentation: To calculate the maximum wait queue size, the driver multiplies WaitQueueMultiple by MaxConnectionPoolSize. If you use the default value for each option, the wait queue size will be 500.
In reality, the queue size remains the same default value 500 when the MaxConnectionPoolSize is modified via the MongoClientSettings object, like so:
const string connectionUri = "mongodb+srv://<u>:<p>@<host>/?retryWrites=true&w=majority&maxPoolSize=500"; var settings = MongoClientSettings.FromConnectionString(connectionUri); settings.MaxConnectionPoolSize = 500;
Expected Behaviour:
[WaitQueueSize = 2500]
Actual Behaviour:
[WaitQueueSize = 500]
Workaround:
Setting maxPoolSize in the connection string does impact the queue size:
const string connectionUri = "mongodb+srv://<u>:<p>@<host>/?retryWrites=true&w=majority&maxPoolSize=500";
Or WaitQueueSize can be set explicitly, but it's a deprecated option and the approach is advised against by our documentation:
settings.WaitQueueSize = 2500;
Hypothesis:
The line
MongoClientSettings.FromConnectionString(connectionUri);
appears to compute the WaitQueueSize before MaxConnectionPoolSize gets updated.
- related to
-
CSHARP-6153 Remove obsolete waitQueueSize and waitQueueMultiple connection pool options
-
- Closed
-