Blend warm and cold invocations into an average billed duration, GB-seconds and timeout headroom for a Lambda function.
Lambda bills in 1 ms increments, so the average billed duration is the invocation-weighted blend of warm and cold executions rounded up. Init duration on a cold start is billed for SnapStart and provisioned concurrency but not for a standard on-demand invocation, which is why the blended figure is what your GB-second meter actually sees. Compute the cost with the GB-second rate for your region rather than assuming the default here is current. Duration is the one variable you can usually cut without changing anything else: halving it halves the compute half of the bill and, unlike memory, it also improves the latency your users feel.
Lambda Duration
billed duration = warm ms × (1 − cold rate) + (warm ms + cold-start ms) × cold rate, rounded up to the next millisecond; GB-seconds = memory GB × billed seconds × invocations.
billed duration = warm ms × (1 − cold rate) + (warm ms + cold-start ms) × cold rate, rounded up to the next millisecond; GB-seconds = memory GB × billed seconds × invocations. Lambda bills in 1 ms increments, so the average billed duration is the invocation-weighted blend of warm and cold executions rounded up. Init duration on a cold start is billed for SnapStart and provisioned concurrency but not for a standard on-demand invocation, which is why the blended figure is what your GB-second meter actually sees. Compute the cost with the GB-second rate for your region rather than assuming the default here is current.
Duration is the one variable you can usually cut without changing anything else: halving it halves the compute half of the bill and, unlike memory, it also improves the latency your users feel.
This calculator takes 7 inputs: Invocations per month, Memory configured, Warm invocation duration, Extra latency on a cold start, Share of invocations that cold start, Configured timeout, Price per GB-second. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
No. Set the timeout above your p99.9 cold-start duration but low enough that a hung downstream call fails fast instead of burning 15 minutes of GB-seconds. A timeout two to three times the cold-start duration is a common compromise.