The Mathematics of Concurrency: When Does a Request Start Cold?
Serverless functions (like AWS Lambda or Google Cloud Functions) run one request per execution environment and scale out by creating more environments. A request starts cold when no idle environment is available and the platform must create one. After an environment finishes, the platform keeps it idle for a while and then reclaims it, so whether a request is cold depends on how recently that much capacity was last needed.
With requests arriving at random, the number of busy environments at any moment follows a Poisson distribution with mean λ = R_ingress × ( T_duration / 1000 ) where R_ingress is requests per second (RPS) and T_duration is the average execution time in milliseconds. This holds for any distribution of execution times, and an arriving request sees the same distribution: P(X = k) = (λ^k e^(-λ)) / k!
To optimize your overall serverless deployment, you can evaluate monthly compute bills with the serverless compute cost calculator or plan host node allocations using the Kubernetes capacity planner.
Think of the environments as levels: level k is needed when a request arrives while k - 1 are already busy. That happens at a rate u_k = R_ingress × P(X = k - 1) If those moments are further apart than the idle timeout T_idle, the environment for level k has usually been reclaimed and the request starts cold. Treating the moments as random, the chance that the gap exceeds the timeout is e^(-u_k T_idle), so Cold starts per second = Σ_(k > c) u_k e^(-u_k T_idle) where c is the provisioned concurrency, whose environments never go cold.
The result behaves the way real functions do. Busy levels are needed every fraction of a second and stay warm; only the rare bursts to levels far above the average are cold. A function called once every 17 minutes with a 10-minute idle timeout starts cold about 55% of the time, while one serving 20 requests a second starts cold on well under 0.01% of requests. Cold starts are a low-traffic and burst problem, not a high-traffic one.