Wait Queue is Full - Understand Connections

We are having an issue in production (replica set, version 4.2.1). We track email clicks and opened emails. When large email blasts are sent it slows down our website and users are unable to login.

We get the following error:
The wait queue for acquiring a connection to server x is full.

Here are some server stats when this happens:

        "current" : 218,
        "available" : 50982,
        "totalCreated" : 208189,
        "active" : 186
db.runCommand( { "connPoolStats" : 1 } )
        "numClientConnections" : 0,
        "numAScopedConnections" : 0,
        "totalInUse" : 0,
        "totalAvailable" : 1,
        "totalCreated" : 59272458,
        "totalRefreshing" : 0,

There is nothing that we have configured for connections in the config file. We must have the default settings. We use the C# driver and we can see the MaxConnectionPoolSize is 100 and the WaitQueueSize is 500.

Here are my questions

  • Is there any way to see the queue size?
  • I have 100 max connections, but the server is showing 218 active connections. How is this possible?
  • It seems the solution would be to simply increase the pool size, but to what number? I wss thinking of setting it to 1000.
  • Can there really be over 50K connections available by default?


This is a recurrent problem that we have not found the answer yet.
Any help would be appreciated.


This is relentlessly happening to one of our apps too. There’s also seemingly no pattern to it, just suddenly nothing can connect, the wait queue builds up and then it just starts throwing wait queue exceptions and can’t seem to recover itself.