Currently using:
-
.NET MongoDB.Driver v2.13.1
-
Mongo cluster (replica set), with primary (v4.4.6) and two secondaries (v4.4.8).
-
Connection string is:
mongodb://{login}:{password}@master.local:27017, worker-1.local:27017, worker-2.local:27017/?replicaSet=rs0&minPoolSize=20&maxPoolSize=1000&connectTimeoutMS=10000
We are currently experiencing some awkward behaviour of our Mongo .Net Core 3.1 API during our load tests. Exception that troubles us is:
A timeout occurred after 30000ms selecting a server using CompositeServerSelector
{
Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector,
LatencyLimitingServerSelector
{
AllowedLatencyRange = 00:00:00.0150000
},
OperationsCountServerSelector
}
Client view of cluster state is
{
ClusterId : "1",
ConnectionMode : "ReplicaSet",
Type : "ReplicaSet",
State : "Disconnected",
Servers : [
{
ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/ worker-1.local:27017" }",
EndPoint: "Unspecified/ worker-1.local:27017",
ReasonChanged: "ServerInitialDescription",
State: "Disconnected",
ServerVersion: ,
TopologyVersion: ,
Type: "Unknown",
LastHeartbeatTimestamp: null,
LastUpdateTimestamp: "2021-09-16T11:20:03.0135378Z"
},
{
ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/ worker-2.local:27017" }",
EndPoint: "Unspecified/ worker-2.local:27017",
ReasonChanged: "ServerInitialDescription",
State: "Disconnected",
ServerVersion: ,
TopologyVersion: ,
Type: "Unknown",
LastHeartbeatTimestamp: null,
LastUpdateTimestamp: "2021-09-16T11:20:03.0141756Z"
},
{
ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/master.local:27017" }",
EndPoint: "Unspecified/master.local:27017",
ReasonChanged: "ServerInitialDescription",
State: "Disconnected",
ServerVersion: ,
TopologyVersion: ,
Type: "Unknown",
LastHeartbeatTimestamp: null,
LastUpdateTimestamp: "2021-09-16T11:20:03.0118832Z"
}
]
}.
Error happens in 5% cases when RampUp period of virtual users is long (60sec), but in 99% cases when RampUp is 0 or some small number (like 5sec).
For the first minut or two of the test, .NET API starts throwing these exceptions for some requests, and some requests take quite a while to execute.
Any info about the cause is helpful