Is it possible and how to identify Rate Limit Exceedance in CosmosDB for MongoDB Using the Standard MongoDB SDK

Aaron Tan 20 Reputation points
2024-04-14T05:06:23.5533333+00:00

Hi There,

We are using standard mongodb SDK to access CosmosDB for MongoDB. Sometimes it reaches the rate limit and reject many requests. We need to identify this scenario and stop sending documents for a while. Could you please how to achieve it through standard mongodb SDK?

Looks like it would throw a MongoExecutionTimeoutException with message like: Request timed out. Retries due to rate limiting: True.

Thanks

Aaron

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,445 questions
{count} votes

Accepted answer
  1. ShaktiSingh-MSFT 13,426 Reputation points Microsoft Employee
    2024-04-15T05:48:25.4566667+00:00

    Hi Aaron Tan •,

    Welcome to Microsoft Q&A forum.

    As I understand, you want to know if it is possible and how to identify Rate Limit Exceedance in CosmosDB for MongoDB Using the Standard MongoDB SDK.

    Azure Cosmos DB for MongoDB operations might encounter rate-limiting, resulting in 16500 errors in mongo request metrics, if they exceed a collection's throughput limit (RUs).

    Enable Server Side Retry (SSR) to automate operation retries. SSR retries requests across all collections in your account with short delays. If a 60-second timeout is reached, a client receives an ExceededTimeLimit exception (50).

    Refer https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/prevent-rate-limiting-errors for more details.

    and

    https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/troubleshoot-request-rate-too-large?tabs=resource-specific

    Also, take a look at this stackoverflow thread https://stackoverflow.com/questions/76794326/when-does-the-v3-cosmos-db-net-sdk-for-nosql-retry-write-requests if helps.

    Let us know you query so that we can further assist.

    Thanks

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful