Too many connections from MongoDB agent


I recently got a notification about too many open connection to the primary in my Atlas hosted DB. Upon checking the logs, I found a repeating connection in this pattern:

[listener] connection accepted from #502401 (2694 connections now open)
2021-01-28T11:18:15.735+0000 I NETWORK [conn502401] received client metadata from conn502401: { driver: { name: “mongo-go-driver”, version: “v1.3.4” }, os: { type: “linux”, architecture: “amd64” }, platform: “go1.14.7”, application: { name: “MongoDB Automation Agent v10.23.3.6702 (git: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)” } }

Why is the MongoDB Automation Agent making so many connections. How can I resolve this issue. Out of the 3000 max connections, it seems like almost 2500 are being used by the agent. Kindly help.


Hi Sagar,

This definitely sounds unexpected: please open a case with the MongoDB support team (or in-UI chat help desk) – the team should investigate and ensure there isn’t something unexpected here.


Thank you for the reply Andrew! I did contact the support team and was suggested to do a failover test. I decided to wait instead. Since then, the number of connections have been stable. Will post updates here in case anything new happens.

I am facing the issue again. This time I noticed that the logs downloaded from atlas show a different number of open connections (around 1800) vs what is shown in atlas console (around 3000). When it it close to 3000 the connections begin to drop. Any clues as to what could be the reason for these extra 1200 connections not shown in the log?


Hi Sagar have you engaged with the support team in the UI?


Yes I contacted them. And they helped me understand how to analyze the logs using mtools. I was able to track the application that was causing the issue and resolve it.
Newbie mistakes but here is the summary:
For anyone else reading this, make sure to download the correct logs for primary replica set. I wasted a lot of time because I was downloading logs for secondary replica set which was not reflecting the real cause of the problem. mloginfo command in mtools allows you to see the connections opened/closed. That will help you see the IP address of the source of the connection and you can track the source of problem from there.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.