Connection Limit reached on M0 cluster despite killing all possible activity

Hi everyone, I’m encountering a VERY strange “connections to your cluster(s) have exceeded 500” in my M0 cluster, and can’t seem to make it go away no matter what I try. For context, our atlas cluster is accessed exclusively through a Mongodb Realm app, through the app.currentUser. We use realm-web v1.2.1 nodejs driver.

A few puzzling things about my situation:

  1. there should be no users currently using it, it’s a development instance and both developers were offline/asleep. Even so, it’s maintained ~500 connections for the last 24+ hours
  2. the only op type in the Opcounters graph is “commands”. There are no queries/deletions/updates/etc for the last 24+ hours, yet there is consistently 15 “commands”/second to the cluster somehow.

I have tried:

  1. killing all hosted/adhoc instances of the webapp which is using Realm. This did nothing.
  2. removing all ip addresses from the Ip Access list in Network Access for 30 minutes, so theoretically nothing should be able to access the cluster. Even so, connections remained elevated at 500.
  3. Finally, I disconnected my Realm app from the atlas cluster as a data source entirely. Finally after this, the # of connections is going down by about 3 per hour.

Does anyone have any guidance on what could possibly be going on here, and what I can do about it? The opaqueness of the situation is a bit frustrating. We were pretty sure we were going to upgrade to M3+ eventually once the app had a real launch, but need to be confident we can work through critical fires like this.

Thank you.


The monitoring dashboard for the primary shard:

I am seeing exactly the same issue. Suddenly started yesteday.

My active connections have started to slowly drop.

I’m seeing the same thing. Started yesterday around 10 PM EST.

Facing the same issue too for M0! Please address this issue ASAP

1 Like

The issue seems to have fixed itself for my M0 cluster. I contacted in-app support, and they confirmed that they were investigating this. So perhaps they ended up being able to fix it?

I started a new M0 cluster and moved my data over but that didnt seem to help. Then I refactored my mongo client to follow the singleton pattern and the problem never occurred again. I don’t know if this helps

hi all,
i am having the same issue while using realm on atlas m0,
i built a custom realm function and tested it by clicking on “run” on the realm GUI,
the connection just pops up to 499 and eventually i have no way to decrease the count, the app connection just died and cannot do anything,

i removed all IP list in whitelist and use instead, but nothing helps

please any engineer from mongoDB support can help address this issue?
we were planning to move to M10 for the app release but this really makes us to re-consider the technology,

i have the same issue, im connected just with one application, and the limit has exceed
anyone ?

How do you manage the connections in your application?

I have seen code where a new client (so a new connections pool) is created at each request. You quickly go out of connections this way.

I had recently a lot of warnings that “connections to your cluster (s) have exceeded”. It is an issue with application’s code :slight_smile: I mean we need to avoid new connection on each call to a db. Take a look how it is done in NextJS example: or how it is explained in the movie: Fullstack SvelteKit ToDo App with TailWind CSS and MongoDB - YouTube

1 Like