When Does Cold Start Happen on AWS Lambda?

The first cold start happens when the very first request comes in.

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 attempts to answer 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:

Cold and warm latency as a function of interval between two subsequent requests

The lifetime of an idle instance is 10 minutes.

This is confirmed by the following chart, which estimates the probability of a cold start (Y-axis) by the interval between two subsequent requests (X-axis):

Probability of a cold start happening before minute X

This behavior is different from the past, here is a month-over-month view:

The typical lifetime of an idle AWS Lambda

Go back to Cold Starts in AWS Lambda.