Skip to content
The Machine

04.05 · Concept

Serverless Internals

Describe what actually boots when a function is invoked, and why cold start is a distribution rather than a number.

No video curated for this lesson yet

This lesson is written, ordered and part of the path - the video slot is the only thing still open. We are working through Deployment lesson by lesson; 29 of 56 have their video so far.

The written notes below cover this idea in full - you lose nothing by reading instead of watching.

A serverless invocation may start a sandbox, runtime, application artefact, module initialisation and only then the handler. Warm paths skip much of that work. Cold start is not a single latency value because placement, caches, image size, runtime setup, networking and burst concurrency all vary per invocation.

What this lesson answers

  • what happens during a serverless cold start
  • why cold start latency has p99 spikes
  • how provisioned concurrency changes cold starts

Notes

Serverless Cold Start Path — Serverless cold starts exist because a platform must create or reuse isolated compute before running user code, and without that boot path an invocation would either have no sandbox, no runtime, or unsafe tenant isolation.

Key Concepts: - A cold invocation typically includes , while a warm invocation is closer to . - AWS Lambda may boot a Firecracker microVM, attach a runtime such as Node.js 20 or Python 3.12, load the function package or container image,…

Common questions

What actually starts when a serverless function is invoked cold?
The platform first has to provide isolated compute, such as a microVM, container or isolate. It then attaches the language runtime, makes the function package or image available, runs code outside the handler, and finally calls the handler. Which parts happen depends on the provider and whether usable capacity is already warm.
Why is cold start latency a distribution instead of one number?
Different invocations take different paths. One may land on a worker with cached layers and an available runtime, while another waits for placement, image fetch, unpacking, runtime setup or network initialisation. Percentiles matter because the slow tail is often what users and upstream services experience during bursts or cache misses.
Does provisioned concurrency remove cold starts?
Provisioned capacity moves much of the boot work before the request arrives. The sandbox, runtime and application initialisation can already be ready, so request latency is closer to a warm path. It does not make handler code free, and it only helps for traffic covered by the provisioned capacity.