Change in Azure SQL Database serverless auto-pause resume latency when adjusting delay
0 reputation · 09 Aug 2021, 11:52 UTC
0 reputation · 09 Aug 2021, 11:52 UTC
Goal: Choose an auto‑pause delay for the Azure SQL Database serverless tier that minimizes compute cost for a sporadic workload without introducing unacceptable resume latency for end‑users.
Uncertainty: The time required to resume a paused database after the first request is not fixed; observations show a range from a few seconds to more than a minute, influenced by the underlying compute hardware and the Azure region where the database resides. This variability makes it difficult to predict whether a given delay setting will keep latency within service‑level expectations.
Questions: What is the maximum resume latency that the application can tolerate? How does resume latency differ across regions and hardware generations for the same auto‑pause delay? Does increasing the auto‑pause delay beyond the default 60 minutes reduce the frequency of resume events enough to offset the latency penalty?
34775 reputation · 09 Aug 2021, 14:40 UTC
To minimize compute costs without introducing unacceptable latency, you should prioritize the application's maximum tolerable request timeout over the auto-pause delay setting. Increasing the auto-pause delay (e.g., from 60 minutes to 240 minutes) reduces the frequency of cold starts but does not reduce the duration of the resume latency when a cold start eventually occurs.
It is a common misconception that a shorter auto-pause delay leads to faster resumes. In Azure SQL Database serverless, the resume latency is primarily a function of the underlying infrastructure's ability to allocate compute resources and attach the storage, not the length of time the database was paused. While some variance exists, the following behaviors are generally observed:
Because latency varies by region and hardware, you must empirically determine the threshold for your specific deployment:
Azure Monitor to track the resume latency metric. Execute a request after the database has entered the paused state and record the time to first byte.Azure Cost Management.Timeout Expired errors during cold starts.To provide a more precise recommendation on the delay value, please specify: What is the maximum request timeout configured in your application's connection string? If the timeout is shorter than the observed regional resume latency, no amount of delay adjustment will prevent intermittent connection failures.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.