CosmoDB Handling Request Throttling

Tahmid Eshayat 286 Reputation points
2020-06-24T01:39:54.057+00:00

Hi there,

I'm wondering, how can I properly handle a throttled request, I have forever tried in my Polly, But I'm still getting throttled requests.

https://pasteboard.co/Jev0xcQ.jpg

Thanks

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

1 answer

Sort by: Most helpful
  1. Matias Quaranta 1 Reputation point Microsoft Employee
    2020-07-01T14:53:09.403+00:00

    Throttling (429s) indicates that your provisioned throughput is not enough for the volume of operations you are currently doing, each operation consumes an amount of RU, and you have a limit quantity provisioned, if the sum of the consumed RU on a second go over the provisioned, the other requests will get throttled. If this is something sporadic due to spike in your usage, then retries can mitigate it (the 429 response contains a header that indicates how long would you have to wait). Our SQL SDKs automatically retry for you (you are using C# so you can use our C# SDKs https://video2.skills-academy.com/en-us/azure/cosmos-db/create-sql-api-dotnet) for a default number of times (which can be customized).

    Retries by themselves won't solve the 429s though. If your 429s are constant, what you might want to consider is increasing the provisioned throughput (https://video2.skills-academy.com/en-us/azure/cosmos-db/set-throughput) or reducing the volume of operations to accommodate what you have currently provisioned.


Your answer

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