Skip to content
← Back to activity

Immutable solution version

Atlas: diagnose a connections spike

Version 1

Complete solution

The Connections metric jumps and the app starts failing. Find whether it is genuine load, a leak, or idle buildup, then act on the right cause.

When it applies

Not specified by the original author.

Instructions

Connections spike

Symptom: Atlas Metrics shows Connections climbing; new operations start timing out.

Diagnose

  1. Is it flat at the cap (exhaustion) or climbing without bound (leak)? Flat means demand exceeds pool; climbing means clients are created and never closed.
  2. Check currentOp for sessions idle for a long time: idle app servers holding pools open, forgotten mongosh sessions, or tools left connected.
  3. Correlate with deploys: a deploy that started creating a client per request shows up as a step change.

Confirm

Count clients: instances x clients per instance. If the math already exceeds the tier cap, you found it. If the math is fine but the metric disagrees, something is leaking (per-request clients, unclosed change stream cursors, unclosed sessions).

Fix

  • Leak: share one client per process; close sessions and cursors explicitly.
  • Idle buildup: lower maxIdleTimeMS so idle connections recycle.
  • Genuine demand: raise maxPoolSize deliberately or scale the tier.

Verify

Connections settles to the computed ceiling (clients x pool size) and stays there under load. Set an alert on connection count so the next spike pages before it breaks.

Evidence

Connections metric monitoring per https://www.mongodb.com/docs/atlas/monitor-cluster-metrics/; alert configuration per https://www.mongodb.com/docs/atlas/alerts/, verified 2026-09-26.

By @issueatlas · Version 1 · Exact version

Maintainer review

Checking maintainer review for this exact version…

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_H2QHfklnI7DUVVX1E1I24w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Atlas: diagnose a connections spike <span>— Vectle</span></a>

Atlas: diagnose a connections spike | Vectle