Estimate Lambda cold-start latency from runtime, package size, VPC attachment and init code, and see which factor dominates.
A cold start is the sum of downloading and unpacking the artefact, booting the runtime and running everything outside your handler. Package download scales with artefact size, VPC attachment adds a fixed network setup cost, and heavy SDK or framework imports usually dominate everything else. The coefficients here are order-of-magnitude figures — read the real numbers from the initDuration field in your CloudWatch REPORT lines. Cold starts land on real user requests at exactly the wrong moment — during a deployment or a traffic spike — so knowing which of the four contributors dominates tells you whether to shrink the package, lazy-load clients, or pay for provisioned concurrency.
Lambda Cold Start
cold start ≈ runtime bootstrap + 8 ms per MB of package + 110 ms if VPC-attached + your init code, then multiplied by about 0.25 when SnapStart restores a snapshot.
cold start ≈ runtime bootstrap + 8 ms per MB of package + 110 ms if VPC-attached + your init code, then multiplied by about 0.25 when SnapStart restores a snapshot. A cold start is the sum of downloading and unpacking the artefact, booting the runtime and running everything outside your handler. Package download scales with artefact size, VPC attachment adds a fixed network setup cost, and heavy SDK or framework imports usually dominate everything else. The coefficients here are order-of-magnitude figures — read the real numbers from the initDuration field in your CloudWatch REPORT lines.
Cold starts land on real user requests at exactly the wrong moment — during a deployment or a traffic spike — so knowing which of the four contributors dominates tells you whether to shrink the package, lazy-load clients, or pay for provisioned concurrency.
This calculator takes 8 inputs: Runtime, Deployment package size, Initialization code outside the handler, Function is attached to a VPC, SnapStart or a pre-warmed snapshot is enabled, Warm invocation duration, Invocations per month, Share of invocations that cold start. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
For a standard on-demand invocation the initialization phase is not billed, which is why cold starts hurt latency more than cost. SnapStart restore time and provisioned-concurrency initialization are billed, and both change the arithmetic.
No. Before the Hyperplane rework, VPC-attached functions could take ten seconds or more to attach an ENI on a cold start. Shared ENIs cut that to roughly 100 ms, so VPC attachment is now a minor factor next to a bloated package or a slow framework boot.