Skip to content

Cosmos DB for MongoDB Performance Troubleshooting

Purpose

Use this guide to investigate whether Azure Cosmos DB for MongoDB is contributing to slow ProcessFactorial actions in a Customer Hosted Model. This guide covers Request Unit (RU) based accounts; its throughput checks do not apply to vCore accounts.

You will need access to the affected Cosmos DB account in Azure. Ask your hosting administrator to perform these checks if you do not have access.

Symptoms

  • Actions involving stored data take longer than usual.
  • Database request latency or throttling increases during the slow period.
  • Database traffic rises while application responses become slower.

These symptoms suggest where to investigate; they do not confirm a database capacity problem.

Troubleshooting steps

1. Select the affected resource and time range

  1. In the Azure Portal, open the Cosmos DB for MongoDB account used by the affected environment.
  2. Open Monitoring → Insights and select the smallest useful time range covering the incident, including time before and after it.
  3. Use the same time zone and time range when comparing application and database charts.
  4. Compare with a normal period of similar activity. Record the database, collection, region, chart aggregation, and time grain used.

2. Check the throughput configuration

  1. Open Data Explorer, select the database, and inspect Scale. Record whether throughput is manual or autoscale and the configured RU/s or maximum RU/s.
  2. Inspect each affected collection's Settings or Scale view. Determine whether it uses database-level shared throughput or dedicated collection throughput.
  3. Compare this with the intended hosting configuration. A separate collection throughput control indicates dedicated capacity; confirm the setting rather than relying only on whether a tab is visible.

A dedicated collection does not draw on the database's shared throughput allocation. Shared throughput is the expected arrangement where specified by your hosting configuration; dedicated throughput alone does not prove a fault.

Example of a collection with its own throughput setting

  1. Review the account's Features, including burst capacity and server-side retry, against Scaling Options - MongoDB.

Burst capacity can help with short peaks when capacity is available. Server-side retry can allow throttled requests to complete, but may increase their duration. Neither guarantees sufficient capacity for sustained demand.

3. Review throughput and request metrics together

In Monitoring → Insights, review Throughput and Requests. For more focused comparisons, open Monitoring → Metrics, select the relevant metric, and filter or split by the available database, collection, operation, status, or region dimensions.

Chart or measurement What to check
Total RUs Check the aggregation and time grain. A sum is consumption across the interval; divide by its duration in seconds for the average RU/s. This average can hide brief peaks.
Highest RU consuming shard / normalized RU consumption A value near 100% indicates throughput pressure on at least one partition within the chart's aggregation. Check duration, partition distribution where available, throttling, and latency together. It is not merely an activity indicator.
Provisioned throughput Compare configured capacity with consumption for the same scope and time period. Reaching an autoscale maximum is a clue, not proof of user impact.
Failed client requests by operation type Inspect status or error codes and affected operations. Capacity-related throttling differs from authentication or other request failures.
Client requests and total RUs by request type Determine whether the rise is in request volume, RU cost, or particular operations. Compare with normal activity to identify unexpected repeated requests.

Example throughput charts in Cosmos DB Insights

Additional throughput charts for comparison

Example request charts in Cosmos DB Insights

Additional request charts for comparison

Cosmos DB for MongoDB can report throttling as error 16500. Successful client requests do not rule out throttling: server-side retry may hide intermediate failures while adding delay. Inspect throttling and latency as well as final failures. See Microsoft's rate-limiting guidance.

4. Compare latency and availability

  1. Review Latency by operation and region. Compare the affected operation with its normal duration; there is no single latency threshold that proves overload for all operations.
  2. Match any latency increase to the slow user action and throughput or throttling changes.
  3. Check Availability and Azure service health for the incident window. An outage can explain a temporary slowdown even if capacity looks normal later.
  4. Check storage trends if the dataset has grown or Azure reports storage-related limits. Storage volume alone does not establish the cause of a delay.

Example server-side latency by region and operation

Evaluate possible causes

Possible cause Evidence supporting it What could mislead you / how to check
Insufficient throughput for sustained demand Throttling and increased latency coincide with the affected action and sustained throughput pressure. A short RU peak or 100% maximum alone is insufficient. Check duration, aggregation, and whether users were delayed.
Uneven load across partitions or collections One partition or collection is under pressure while others have capacity, with matching delays. Account-wide averages can hide local pressure. Compare the available collection and partition breakdowns before increasing overall capacity.
Throughput configuration differs from the intended setup An affected collection has a separate capacity limit inconsistent with the hosting configuration and reaches that limit during the incident. Dedicated throughput may be intentional. Confirm the expected arrangement with the hosting administrator.
Extra database traffic is a symptom of repeated attempts elsewhere Request volume rises alongside application or dependency failures, without a corresponding rise in normal user activity. High RU usage alone does not establish that MongoDB started the issue. Compare the timing of failures and repeated requests across components.
Slow requests complete after retries Client latency rises alongside rate limiting even though final requests succeed. An empty failed-client-requests chart does not rule out a database delay. Check server-side throttling and retry evidence.
Availability or connectivity issue Service-health events or connection failures match the incident window. Increasing RU/s will not fix an outage or connectivity problem. Ask the administrator to verify the reported event or connection issue.

Resolution options

Choose the option supported by the findings above.

  • Sustained throughput pressure: Ask the hosting administrator to review provisioned RU/s or the autoscale maximum and adjust capacity for the affected scope. Monitor cost and repeat the same workload to confirm reduced throttling and latency.
  • Unexpected collection throughput configuration: Have the administrator plan the correction to the intended shared or dedicated arrangement. Changing that arrangement may require moving data; do not delete or recreate collections as a troubleshooting experiment.
  • Short bursts: Review burst capacity and server-side retry with the administrator using the linked hosting guidance. Confirm that user-visible duration improves; fewer reported errors alone is insufficient.
  • Uneven or unusually costly operations: Share the affected collections, operations, timings, and RU trends with ProcessFactorial Support. Increasing overall throughput may not address the underlying pattern.
  • Repeated attempts caused elsewhere: Resolve the originating failure with the owner of the affected component, then check whether database traffic and latency return to normal.
  • Availability or connectivity issue: Ask the hosting administrator to follow the relevant Azure service-health or connectivity guidance.

Verify the result

Repeat the affected action at comparable load. Compare its duration, throttling, latency, and RU consumption with the original incident. Confirm that improvement persists during a representative busy period.

If the cause remains unclear, share the resource and collection names, incident window and time zone, throughput settings, relevant charts, and changes tried with your administrator or ProcessFactorial Support. Exclude credentials and sensitive record content.