MongoDB Connection Count Issues and You: Noteworthy at Compose


This is your weekly summary of Compose news for those changes and updates which can make your life easier. In this August 28th 2018 edition, we look at connection count issues with MongoDB. And we also take a browse through the past week's Compose Articles.

MongoDB Connection Counts

TL;DR: If you run MongoDB and Node with the official MongoDB Node driver, update your driver to version 3.1.3 or later.

Recently, we have seen customers with MongoDB have connection counts hitting the limits of their database deployment. A quick refresher on connection limits. Connections can be expensive depending on which database you are dealing with. The more connections you have, the more memory is consumed to handle those connections and the less memory you have to handle your database's working set of data.

That's why there are limits - to stop you eating all your memory on not-database operations. For example, on Compose PostgreSQL the connection limit starts off at 100 connections. Connections there take a fair chunk of memory so they need to be constrained. On MongoDB, connections are a lot lighter and we set the limit at 5000. That's across the database as a whole, not particular portals. So, with 5000 connections it should be pretty hard to hit the limit and if you do, chances are there's something up with your application.

Which is why it was interesting to see a number of Compose customers doing just that, hitting the 5000 connection limit very quickly. Our support team and developers looked into the issue and couldn't see any internal problem which would generate these problems. Customers assured us they were carefully pooling their connections which is a great way to avoid connection blowout. So we wondered if it was a widespread problem with a driver.

Then we were shown this ticket from the MongoDB Node driver, one of a number of issues regarding connection growth. It is one of a number of fixes in version 3.1.3 which was released on the 13th of August. We've now had reports that applying this version seems to eliminate the rapid connection growth issue that some users are experiencing.

So, if you are experiencing a connection blowout and you run MongoDB with the MongoDB Node driver, update your driver to version 3.1.4 - which just came out, and please, test your application again. We hope that this change will resolve the problem, but just drop a line to Compose Support if you experience anything similar.

Compose articles

Last week, we started the seven day cycle with Noteworthy news that MongoDB Classic was no longer provisionable on We then released Redli, a Redis client and caught up with the news.

That's it for this week's Noteworthy at Compose. Onwards to next week!

Dj Walker-Morgan
Dj Walker-Morgan was Compose's resident Content Curator, and has been both a developer and writer since Apples came in II flavors and Commodores had Pets. Love this article? Head over to Dj Walker-Morgan’s author page to keep reading.

Conquer the Data Layer

Spend your time developing apps, not managing databases.