liveBook · Manning

Cold start problem

As explained in Grokking Software Architecture

A cold start is the startup latency incurred when a serverless runtime must initialize an execution environment and load function code before handling an invocation.

A cold start is the delay before a serverless function handles a request after scaling down to zero. The cloud must find hardware, start the runtime environment, and load the function code; this boot-up can take a second or two. Scaling to zero saves money when idle, but the next request pays the startup penalty. section 9.4.4

To reduce the delay, keep the function’s deployment package lightweight and minimize external dependencies. That helps the environment start faster, but serverless still brings constraints such as execution time limits and stateless code. section 9.5.2 section 9.12

When a pause is acceptable

A cold start may frustrate someone waiting on an API response, but a one-second delay can go unnoticed while a function processes a queue message, sends email, or generates a nightly report. section 9.4.4

How Grokking Software Architecture covers it

How deep it goes
Traces the delay to provisioning, runtime startup, and code loading, then recommends lighter dependencies and deployment packages.
Examples
Uses a sudden API burst and queue processing, email, or nightly reports to show when startup delay matters.
What you can do after
Apply the guidance by minimizing external dependencies and keeping deployment packages lightweight.
How it connects
Links serverless computing and function-as-a-service to scale-to-zero behavior, execution limits, and stateless code.

Also explained in

Compare how 7 books explain cold start problem →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Software Architecture. The section links point to the parts of the book it draws on.