Throttling in Cosmos DB occurs when you've used up your allocated Request Units within a one-second window. The resulting 429 status code indicates the duration, in milliseconds, you must wait before retrying your operation
By default, he Azure Cosmos DB client SDKs automatically retry requests on 429s. If you are using the SDK, You can change the default retry count by setting the RetryOptions on the CosmosClientOptions instance. By default, the CosmosException with status code 429 is returned after a cumulative wait time of 30 seconds if the request continues to operate above the request rate. This error is returned even when the current retry count is less than the maximum retry count, whether the current value is the default of 9 or a user-defined value.
when in my total request metrics 429 errors appear in one minute, what exactly is it? The metrics indicates the number of throttled requests per minute for the given time range.
And the metric that appears is counting the same query that is retried several times as if they were different queries? or the account independently? Metrics covers all the queries which have been retried even for multiple times.
All the answers are covered here in the below links.
- https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/performance-tips-dotnet-sdk-v3?tabs=trace-net-core
- https://learn.microsoft.com/en-us/azure/cosmos-db/use-metrics#understand-how-many-requests-are-succeeding-or-causing-errors Also watch this video if you would like to understand throttling basics. https://www.youtube.com/watch?v=5xeHRUPP0fE