Azure DocumentDB (with MongoDB compatibility) - Connection timeouts / no connection possible + CPU spike

schlichi 20 Reputation points
2026-05-21T06:57:47.1733333+00:00

The cluster has been running stably for weeks without issues. No configuration changes have been made to the cluster, the VNet, the Private Endpoint, the firewall rules, or the consuming App Service in the days/weeks leading up to the incident. Since approximately 2026-05-20, all connection attempts to the cluster fail with MongoServerSelectionError: Server selection timed out after 30000 ms

This affects both connection paths:

  • From the Azure App Service inside the cluster's VNet via the Private Endpoint (different subnet, peering and VNet integration unchanged)
  • Direct connection via mongosh / MongoDB Compass from a developer machine whose public IP is present in the cluster's firewall allowlist

In the cluster metrics, we observed a CPU spike to 99.764% the evening before the outage began (around 00:00 / midnight, 2026-05-21). Connectivity has not recovered since.

Azure DocumentDB
Azure DocumentDB

A scalable, fully managed NoSQL database for JSON documents with fast queries and automatic indexing

0 comments No comments

Answer accepted by question author
Vinodh247-1375 44,556 Reputation points Volunteer Moderator
2026-05-21T15:55:03.3333333+00:00

Hi ,

Thanks for reaching out to Microsoft Q&A.

This is almost certainly a backend saturation event on Cosmos DB rather than a networking issue, given both private endpoint and public access paths fail. The 99.7% CPU spike right before the outage is the key signal: it typically indicates RU/s exhaustion, hot partition, or runaway query/index operation that pushed the cluster into an unhealthy state where the MongoDB gateway cannot respond within server selection timeouts. Once the gateway layer is starved, all clients see MongoServerSelectionError regardless of network correctness. Immediate actions: check metrics for normalized RU consumption, throttling (429s), and partition-level skew; review recent queries/index builds or TTL jobs; scale up RU/s or move to autoscale temporarily to recover; restart the app is useless here, but a failover (if multi-region) or backend recycle via support can help. If CPU has not dropped since, open a Sev-A ticket, this is consistent with a stuck physical partition or service-side regression rather than misconfiguration.

Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.