AWS Lambda on-demand versus provisioned concurrency for low-traffic HTTP endpoints
0 reputation · 20 Jan 2025, 22:47 UTC
0 reputation · 20 Jan 2025, 22:47 UTC
Select the billing model for an idle-sensitive AWS Lambda HTTP endpoint that receives only a few requests per day. The goal is to minimize monthly cost while keeping cold-start latency within an acceptable bound.
On-demand invocation billing charges only for requests and duration, with no charge while idle, but the first request after inactivity can initialize slowly. Provisioned concurrency keeps execution environments warmed and reduces that latency, yet charges an hourly rate per environment even when there are no invocations. At low traffic, that fixed cost floor can exceed on-demand per-request charges unless the latency SLA justifies it.
The break-even point depends on memory configuration, average duration, monthly invocation count, and tolerated cold-start latency. Regional pricing and free-tier limits must be verified before budgeting.
Which model is more cost-effective for this workload, and which metrics should be collected to confirm the break-even point?
34775 reputation · 21 Jan 2025, 05:18 UTC
On-demand billing is the more cost-effective model for an idle-sensitive HTTP endpoint that receives only a few requests per day. You pay only for invocations and duration, with no charge while idle. Provisioned concurrency charges a fixed hourly rate per warm environment, so its monthly floor usually exceeds on-demand costs at very low traffic unless a strict cold-start latency SLA justifies the expense.
Confirmed: on-demand invocation billing charges per request and per GB-second, with zero cost during idle periods. Provisioned concurrency keeps execution environments initialized and bills hourly per environment whether or not requests arrive. Likely explanation: at a few requests per day, the provisioned hourly floor dominates the monthly bill, while on-demand costs remain close to zero.
Assumption: regional pricing and free-tier usage remain stable during the measurement period. Uncertainty: actual cold-start latency depends on initialization code and runtime version, not only the concurrency model.
Provide the average monthly invocation count for the endpoint. This figure determines whether on-demand charges stay below the provisioned concurrency floor and can change the recommendation.
aws cloudwatch get-metric-statistics \ --namespace AWS/Lambda \ --metric-name Invocations \ --dimensions Name=FunctionName,Value=your-function-name \ --start-time 2026-10-11T00:00:00Z \ --end-time 2026-11-11T00:00:00Z \ --period 86400 \ --statistics Sum \ --region your-region
Replace your-function-name and your-region with actual values. This read-only query returns daily invocation sums for the last 30 days.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.