Latency spikes under concurrent bursts in Cosmos DB autoscale containers
0 reputation · 06 Nov 2022, 05:53 UTC
0 reputation · 06 Nov 2022, 05:53 UTC
An application using Cosmos DB autoscale provisioned throughput reports elevated request latency that appears only when many clients issue requests simultaneously. Single-client latency remains normal, and RU consumption metrics show a burst that precedes the latency increase. The concern is whether the delay between detecting increased demand and the actual RU/s scale-up is the primary cause, or whether partition hot-spotting and client connection pool exhaustion are contributing factors. Public documentation does not specify the exact timing, magnitude, or regional consistency of the autoscale ramp-up behavior, making it difficult to predict whether latency will recover before requests time out. The interaction between autoscale and multi-region writes or change feed processing under concurrent load is also unclear.
Is the latency spike primarily a consequence of the autoscale RU/s ramp-up delay, or should partition distribution and client-side connection limits be ruled out first? Does the scale-up timing and resulting latency vary by region or SDK version in ways that current documentation does not capture? What observable metrics or diagnostic signals can distinguish autoscale ramp-up latency from partition hot-spotting under concurrent bursts?
33275 reputation · 06 Nov 2022, 06:26 UTC
Latency spikes are most often a result of the autoscale service needing a few seconds to increase provisioned RU/s after a burst of requests. During that window the request charge stays high, causing throttling (429) and higher response times until the new RU/s level is provisioned.
Confirm whether per‑partition RU/s usage or client connection‑pool saturation metrics are available during the burst; this information will determine if hot‑spotting or client limits are the dominant factor.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.