MongoDB Atlas Too Many Connections Error

Share
Workaround available Node.js, Vercel, Lambda, all drivers Updated November 13, 2026Based on 2 user reportsHow we research

Quick answer

Atlas refuses new connections when you hit the tier's connection limit (500 on M0). Reuse one client, set maxPoolSize, and scale up if needed.

Most likely fix: Reuse the client

How to fix it

Try these in order — the most common fix is first.

  1. 1. Reuse the client

    1. Create the MongoClient once outside the request handler and cache it across invocations
    Did this fix it?
  2. 2. Limit the pool

    1. Set maxPoolSize in the connection string, e.g. ?maxPoolSize=10
    2. Close unused connections and restart the app
    Did this fix it?
  3. 3. Scale the cluster

    1. Edit Configuration and pick a larger tier with a higher connection limit
    Did this fix it?

Symptoms

'connection refused because too many open connections', spikes in the Connections chart, serverless functions timing out.

Why it happens

  • New MongoClient created per request (serverless)
  • Large connection pool across many instances
  • Tier connection limit reached

This guide also covers

  • mongodb atlas too many connections
  • connection refused because too many open connections
  • mongodb atlas connection limit

Still not working?

If MongoDB Atlas keeps failing, you're not alone. See every MongoDB Atlas problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other MongoDB Atlas errors

All 10 MongoDB Atlas errors and fixes →