1. Knowledge Base
  2. Studio 3T Tutorials
  3. How to Prevent a MongoDB Connection Timeout

How to Prevent a MongoDB Connection Timeout

If you’ve connected to a hosted instance, chances are you’ve experienced the odd MongoDB connection timeout or drop.

After a relatively short period of inactivity, you might try to run a query from within Studio 3T, but are presented with a server error message box.

If you try again, the query will work properly again.

The reason is that in some configurations, the connection can get dropped by a firewall or a load balancer. This issue is common with MongoDBs hosted on Azure.

The folks over at mLab have some interesting details on this matter: http://docs.mlab.com/connecting/#known-issues.

The solution is to manually set the max connection idle time to 60s (60000ms) in the Connection Manager:

After that, your connection should no longer drop 🙂


Check out these other Studio 3T tips:

Updated on August 21, 2018

Was this article helpful?

Related Articles