What is cold start in serverless?

Answer

A cold start occurs when a serverless function is invoked but there is no existing execution environment (container) ready to handle it. The cloud provider must: provision a new container, download and load the function code, initialize the runtime (JVM, Node.js), run initialization code outside the handler. This process adds latency — typically 100ms–2 seconds, but can be longer for JVM-based functions or large deployment packages. Cold starts happen when a function is first deployed, after a period of inactivity, or when scaling up rapidly to handle traffic spikes. Warm starts reuse an existing container and execute the handler immediately (~1-10ms). Cold starts are one of the main criticisms of serverless for latency-sensitive applications. Mitigation strategies include provisioned concurrency, keeping functions warm with scheduled pings, and minimizing package size.