AWS Lambda’s request path is useful to study because a warm invocation and a cold invocation share an API while requiring different work underneath. These are notes on Mike Danilov’s source-period account, with a conceptual example to explain the tradeoff.
Follow the invocation
The frontend authenticates and routes a request. Assignment infrastructure locates an execution environment; when an appropriate environment is unavailable, placement and initialization add work. The source describes the transition from a worker manager to a partitioned assignment service, and Firecracker microVMs in the compute fleet. Source: AWS Lambda Under the Hood.
Conceptual illustration; labels describe responsibilities, not a deployment specification.
Warm assignment does not eliminate cold starts
A warm environment avoids repeating some initialization work. It does not guarantee that every request finds a suitable environment. Concurrency changes, deployments, idle reclamation, and configuration can affect reuse. The worker manager’s purpose should not be described as eliminating all cold starts.
For a hypothetical request budget, separate network/frontend time, assignment time, initialization or restore time, and handler time. If the handler dominates a warm invocation, optimizing imports may barely affect that request. If scale-out repeatedly initializes large dependencies, initialization deserves its own measurement.
Snapshots and working sets
The source discusses chunked snapshot distribution and learning which pages are needed during restoration. Snapshot size and bytes actually fetched on a request are different quantities. A large backing snapshot need not be read in full before execution can progress. These details describe the presented infrastructure, not a guarantee that every runtime or invocation uses one identical snapshot mechanism. Source.
What I would measure
Compare cold and warm latency distributions for the same runtime, artifact, memory setting, and traffic shape. Record initialization, restore where applicable, handler duration, errors, and concurrency. Include a representative scale-out test rather than reporting only the fastest warmed request.
An application-level fix should match the observed cost: reduce unnecessary initialization, avoid repeated network setup in the handler, or revise the workload’s concurrency plan. Recheck correctness after moving state outside the handler because execution environments may be reused.
Related reading
NGINX process and reload behavior provides another example of separating lifecycle work from request handling. Powertools for Lambda shows application-level instrumentation.