MongoDb connections dont close

When the n8n mongodb node runs, it creates a lot of connections to the DB, and seems like it’s not closing the connections after it’s done with the task.

My n8n setup runs every 5 minutes and queries from the mongodb node.

Hey @reev_ranj,

Welcome to the community :partying_face:

Which version of n8n are you running?

The version is 1.8.2

1 Like

Any updates on this?

Hey @reev_ranj,

Not yet, The weekend got in the way and a couple of other issue I had to get to. I don’t think we have changed anything in the node recently though so this will likely still be an issue that we need to resolve.

ok Sure, @Jon .
Thanks for the update.

Please update here when this issue has been examined.

Temporarily we have increased the connection capacity of our MongoDB cluster as a workaround.

1 Like

Hi there, any updates on this issue? Just noticed my workflow fails because the MongoDB connection limit is exceeded, as the connections don’t close…

Hey @tom.jdg,

Not yet, I have added it my todo list but I have some other issues to look into first.

Alright! Glad to hear the issue is on your to do list. Thanks for the quick response :slight_smile:

I might’ve found a fix for anyone having the same issue: I added the maxIdleTimeMS option to my connection string in n8n. So far it seems to work and connections close themselves automatically after the specified time. :smile:

1 Like

That looks like a good solution for now, Looking at the node we are calling the close so it should be working :thinking:

Will continue looking around.

1 Like

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