0

I am running a MongoDb atlas M20 instance which should have a maximum of 1500 connections in its pool. It has 1 primary and two secondaries. If I look at the server stats I can see the connections are maxing out at 160 as you can see in the diagram below. If I check the logs I see the following errors:

Timed out waiting for a connection and The connection pool is in paused state for server

I have set the connection string to include:

mongodb+srv://bb-live-user:@myserver.mongodb.net/Live?retryWrites=true&w=majority&connect=replicaSet&maxPoolSize=1000

How can I increase the number of connections available and reduce the number of errors?

enter image description here

6
  • Are your connection graphs for the Primary or Secondary? Have you set Read Preference to secondary? Commented Nov 13 at 9:28
  • Left graph is one of the secondaries, Right graph is the primary. I've not set read preference to secondary. Commented Nov 13 at 9:33
  • "connection pool is in paused state" is a client-side error. Check the logs prior to that for actual connection errors. Commented Nov 15 at 2:31
  • I also found this in the logs: System.TimeoutException: at MongoDB.Driver.Core.Clusters.Cluster.SelectServer (MongoDB.Driver, Version=3.5.0.0, Culture=neutral, PublicKeyToken=94992a530f44e321) at MongoDB.Driver.Core.Operations.CreateIndexesOperation.Execute (MongoDB.Driver, Version=3.5.0.0, Culture=neutral, PublicKeyToken=94992a530f44e321) at MongoDB.Driver.OperationExecutor.ExecuteWriteOperation (MongoDB.Driver, Version=3.5.0.0, Culture=neutral, PublicKeyToken=94992a530f44e321) Commented Nov 18 at 10:01
  • and this: A timeout occurred after 29998ms selecting a server using CompositeServerSelector{ Selectors = WritableServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "1", Type : "ReplicaSet", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "Unspecified/XX-shard-00-00-qem3l.mongodb.net:27017" }", EndPoint: "Unspecified/XX-shard-00-00-qem3l.mongodb.net:27017", ReasonChanged: "Heartbeat", State: Commented Nov 18 at 10:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.