At a glance
How close your MongoDB deployment is to running out of connection slots, expressed as a percentage. Everymongodhas a hard ceiling on concurrent connections; this gauge shows what fraction of that ceiling is currently in use. At low values you have headroom; as it climbs toward 100% you approach the point where new connections are refused and your application starts throwing connection errors. The card turns red at>90%: at that point a single traffic burst or a misbehaving client can tip the deployment into refusing connections, which presents to users as a hard outage.
Calculation
The gauge is a direct ratio of two fields in theconnections sub-document of serverStatus:
connections.currentis the number of incoming connections open to thismongodright now.connections.availableis the number of additional incoming connections the member can still accept before hitting its ceiling.- Their sum is the effective ceiling for this member, which is the smaller of the configured
net.maxIncomingConnectionsand what the operating system’s file-descriptor limit allows. This is the crucial subtlety: even if you configure a highmaxIncomingConnections, a lowulimit -nsilently caps the real ceiling, soavailable(and therefore this gauge) reflects the true limit, not the configured one.
- This is server-side saturation, not driver-pool saturation. It measures how full the
mongod’s connection capacity is, not how busy any one application’s client-side connection pool is. A single application with a generousmaxPoolSizeacross many instances is the usual driver of this gauge. - Per-member. On a replica set the gauge reflects the member polled (normally the primary, which carries writes and primary reads). A secondary serving heavy read traffic has its own, independent saturation.
- The 1-minute window on the alert smooths over transient bursts: a brief spike to 92% that immediately recedes will not page, but a sustained climb past 90% will.
current and available counts available on drill-down.
Worked example
A platform team runs a MongoDB 6.0 primary serving an order API from a fleet of 40 application pods. Each pod’s driver is configured withmaxPoolSize: 100. The mongod has net.maxIncomingConnections set to 5000, but the host’s ulimit -n is 4096, so the effective ceiling is lower than the config suggests. Readings taken across a flash-sale on 03 Jun 26.
At 09:00 the deployment sits at a comfortable 29.5%, well inside its headroom. As the flash-sale drives traffic, more pods open more connections; by 14:02 the gauge crosses 90% and the sustained-1-minute alert fires. Note the effective ceiling here is roughly 4,000 (
current + available), the OS file-descriptor limit, not the 5,000 configured. By 14:05 only 10 slots remain and the next surge of new connections will be refused, surfacing to the application as connection refused or pool exhausted errors and, to shoppers, as failed checkouts.
- Immediate: raise the host
ulimit -n(andmaxIncomingConnectionsif needed) to lift the ceiling, giving instant headroom without touching the application. This is the fastest way back below 90%. - Structural: the fleet’s total potential connections (40 x 100) is sized to exactly exhaust the server. The right fix is to lower each driver’s
maxPoolSize(most order APIs do not need 100 connections per pod) so the fleet’s worst-case demand sits comfortably under the ceiling, and to confirm the application is returning connections to the pool promptly rather than holding them open.
- The configured limit is not always the real limit.
maxIncomingConnectionscan be silently capped by the OS file-descriptor limit. Because this gauge derives the ceiling fromcurrent + available, it shows the true limit, which is exactly why it sometimes saturates lower than your config implies. - Saturation is driven by the client fleet, not by query volume. You can have modest Operations per Second (live) and still saturate the pool if many idle clients each hold connections open. Check pool sizing and connection-return behaviour, not just throughput.
- 90% is a “fix it now” line, not a “watch it” line. Unlike a slowly drifting capacity metric, connection saturation fails as a cliff: everything works at 95%, then nothing works at 100%. Treat a sustained red reading as imminent outage, not as a trend to monitor.
Sibling cards to read alongside
Reconciling against the source
Where to confirm the number in MongoDB’s own tooling:Why our number may legitimately differ from the native view:mongosh:db.serverStatus().connectionsreturns{ current, available, totalCreated, active, ... }. Computecurrent / (current + available)to reproduce this gauge exactly.mongostat: theconncolumn shows the live connection count (current); compare it against your known ceiling. Atlas: the Metrics tab has a Connections chart showing current connections against the configured limit; Atlas also exposes a Connections alert. OS limit: checkulimit -nfor themongodprocess, since the effective ceiling is the smaller ofmaxIncomingConnectionsand the file-descriptor limit.
Cross-connector reconciliation:
Known limitations / FAQs
Why does the card saturate below the connection limit I configured? Because the real ceiling is the smaller ofnet.maxIncomingConnections and the operating-system file-descriptor limit (ulimit -n) for the mongod process. If your config allows 20,000 connections but the OS allows 4,096, the effective ceiling is 4,096. This gauge derives the ceiling from current + available, so it reflects the true limit and saturates accordingly. Raise ulimit -n to lift the real ceiling.
Saturation is high but operations per second is low. What does that mean?
Many connections are open but few are doing work: idle clients holding connections, an oversized driver maxPoolSize, or an application not returning connections to the pool promptly. The fix is on the client side: reduce pool sizes to match real concurrency and ensure connections are released after use. High saturation is about how many slots are held, not how busy they are.
What actually happens when this hits 100%?
New incoming connections are refused. Existing connections keep working, but any client trying to open a fresh connection gets a connection error, which drivers usually surface as a pool-exhausted or connection-refused exception. To users this looks like sudden failures even though the database itself is otherwise healthy. That cliff edge is why the alert fires at 90%, not 99%.
Does this gauge include connections to secondaries?
No. serverStatus.connections is per-member, and the card normally polls the primary. A secondary serving heavy reads has its own, independent saturation. If you read from secondaries, monitor their saturation separately, because a read-heavy secondary can saturate while the primary looks fine.
Why is the alert “sustained 1 minute” rather than instant?
Connection counts spike briefly during normal events: a deploy that recycles pods, a batch job opening a burst of connections, a brief reconnect storm after a network blip. Requiring the breach to persist for a minute avoids paging on those transients while still catching a genuine climb toward the ceiling well before refusals begin.
How do I create headroom quickly during an incident?
Two levers. The fast one is to raise the ceiling: increase ulimit -n (and maxIncomingConnections if it is the binding limit), which takes effect for new connections without changing the application. The durable one is to reduce demand: lower each application instance’s driver maxPoolSize so the whole fleet’s worst-case connection demand sits comfortably below the ceiling, and confirm the app returns connections promptly.