When Does Cold Start Happen on Azure Functions?
The first cold start happens when the very first request comes in after deployment.
After that request is processed, the instance stays alive for the time being to be reused for subsequent requests. But for how long?
The following chart answers this question. It plots the response duration in seconds (Y-axis) by the interval since the previous requests (X-axis). Each point represents a single request in the data set. Blue points are cold starts and red points are responses from warm instances:
After that request is processed, the instance stays alive mostly from 20 to 30 minutes to be reused for subsequent requests. Some cold starts happen earlier than 10 minutes, some instances last for more than 50 minutes, so the behavior seems less deterministic than it used to be in the past. It’s likely related to the new algorithm to predict the next invocation.
Here is a formal visualization of the same data. It plots the probability of a cold start (Y-axis) by the interval between two subsequent requests (X-axis):
Go back to Cold Starts in Azure Functions.