I’m currently running an application on DigitalOcean App Platform, but my database is hosted on MongoDB Atlas. Recently, I’ve encountered issues with TCP timeouts, particularly when I leave connections idle for a while. To address this, MongoDB [recommended](Timeout on insert Mongo Atlas with Azure Serverless backend - MongoDB Atlas - MongoDB Developer Community Forums) configuring the TCP timeout setting to 120 seconds, which I think isn’t possible in App Platform.
What are available options for me?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey Jamal! 👋
I don’t think that with the App Platform you direct control over low-level networking configurations like TCP timeouts.
Is it possible for you to try adjusting other connection settings within your MongoDB Atlas cluster? For example, tweaking the connection pool settings (like
maxIdleTimeMS
) might help mitigate idle connection issues.Another option here could be to consider moving to a DigitalOcean Managed MongoDB cluster instead, that might give a better networking latency as the database will be hosted within DigitalOcean’s infrastructure.
If none of those two options work for you, a workaround will be to move your application to a Droplet will give you full control over the system, including the ability to configure TCP timeouts directly. You can customize the server fully as you will have root access and you can make that suggested change from the MongoDB forum to meet your specific needs, but keep in mind this requires more management than a fully managed service like App Platform.
- Bobby