Using MongoDB Atlas on Lambda throws Could not connect to any servers in MongoDB Atlas cluster error

Hey - we can try that - but it feels wrong. In this case the database that we’re connecting to (running in Atlas) is absolutely tiny - barely 50kb of data. At max there is 10 connections open to it. It’s just so small / lightweight that it really shouldn’t be behaving as it is - it makes no sense.

I can understand needing big timeouts - some sort of heavily load scenario’s - but we’re dealing with such a low-load scenario it’s strange. Timing out at 60 seconds or so - just to get the connection to the DB seems very strange indeed.

We’re having a go at trying a slightly different pattern for the initialization of our mongo connection from our Lambda function to see if that makes any difference.

1 Like