Serverless costs explained: invocations, duration, requests, and downstream spend

Serverless estimates fail when you model only invocations. The reliable approach is: invocations + duration + logs + egress + downstream requests. This hub links the best checklists and calculators to avoid thin compute-only models.

1) Invocations and duration (compute time)

  • Convert traffic to invocations per month.
  • Model average duration and consider peak / incident scenarios separately.
  • Hub: request-based pricing

2) Logs and metrics (often the surprise)

  • Verbose logs can dominate for chatty functions.
  • Metrics cost is a cardinality problem; label explosion is common in serverless apps.
  • Hubs: log costs, metrics costs

3) Egress and downstream spend

Related tools

More serverless guides

Aurora Serverless v2 pricing: how to estimate ACUs and avoid surprise bills
A practical way to estimate Aurora Serverless v2 costs: ACU-hours, storage GB-month, backups/retention, and how to model peaks so your estimate survives real traffic.
AWS ECS Pricing & Cost Guide (EC2 vs Fargate drivers)
ECS cost model for compute, storage, and networking. Compare EC2 vs Fargate and identify real cost drivers.
AWS Fargate pricing (cost model + pricing calculator)
A practical Fargate pricing guide and calculator companion: what drives compute cost (vCPU-hours + GB-hours), how to estimate average running tasks, and the non-compute line items that usually matter (logs, load balancers, data transfer).
AWS Lambda cost optimization (high-leverage fixes)
A practical Lambda cost optimization checklist: reduce GB-seconds (duration × memory), control retries, right-size concurrency, and avoid hidden logging and networking costs.
AWS Lambda pricing (what to include)
A practical checklist for estimating AWS Lambda-style costs: requests, duration × memory (GB-seconds), provisioned concurrency when used, logs, and common hidden line items.
Azure Functions pricing: what to include in a realistic estimate
A practical Azure Functions cost model: invocations, duration/memory, networking, and log volume - plus a validation checklist to catch retries, cold starts, and chatty dependencies.
Cloud Functions pricing (GCP): invocations, duration, egress, and log volume
A practical Cloud Functions cost model: invocations, execution time, outbound transfer, and logs. Includes a workflow to estimate baseline + peak and validate retries, cold starts, and log bytes per invocation.
ECS EC2 vs Fargate Cost Comparison
Compare ECS on EC2 vs Fargate using compute, storage, and networking drivers. When each model is cheaper.
Fargate cost optimization (high-leverage fixes)
A practical Fargate cost optimization checklist: rightsize tasks, scale on real signals, reduce idle capacity, and avoid hidden networking and logging costs.
Fargate vs EC2 cost: how to compare compute, overhead, and hidden line items
A practical Fargate vs EC2 cost comparison: normalize workload assumptions, compare unit economics (vCPU/memory-hours vs instance-hours), and include the line items that change the answer (idle capacity, load balancers, logs, transfer).
Fargate vs EKS cost: what usually decides the winner
A practical Fargate vs EKS cost comparison: normalize workload assumptions, compare task-hours vs node-hours, include EKS fixed overhead (cluster fee + add-ons), and account for the line items that dominate both (LBs, logs, transfer).
GCP Cloud Run Pricing & Cost (requests, CPU/memory, egress)
Model Cloud Run cost from requests, duration, CPU/memory time, and egress. Includes validation tips for real workloads.
Lambda concurrency and cold starts (cost pitfalls)
A practical guide to Lambda concurrency and cold starts: how they affect duration and cost, when provisioned concurrency is worth it, and what to measure to avoid surprise bills.
Lambda vs Fargate cost: a practical comparison (unit economics)
Compare Lambda vs Fargate cost with unit economics: cost per 1M requests (Lambda) versus average running tasks (Fargate), plus the non-compute line items that often dominate (logs, load balancers, transfer).

Related guides

Cloud cost estimation checklist: build a model Google (and finance) will trust
A practical checklist to estimate cloud cost without missing major line items: requests, compute, storage, logs/metrics, and network transfer. Includes a worksheet template, validation steps, and the most common double-counting traps.
Compute costs explained: instance-hours, utilization, and hidden drivers
A practical compute cost model: instance-hours (or vCPU/GB-hours), utilization and idle waste, plus the hidden drivers that often dominate totals (egress, load balancers, and logs).
Lambda vs Fargate cost: a practical comparison (unit economics)
Compare Lambda vs Fargate cost with unit economics: cost per 1M requests (Lambda) versus average running tasks (Fargate), plus the non-compute line items that often dominate (logs, load balancers, transfer).
CloudFront vs Cloudflare CDN cost: compare the right line items (bandwidth, requests, origin egress)
A practical comparison checklist for CloudFront vs Cloudflare pricing. Compare bandwidth ($/GB), request fees, region mix, origin egress (cache fill), and add-ons like WAF, logs, and edge compute. Includes a modeling template and validation steps.
Messaging costs explained: requests, deliveries, retries, and payload size
A practical framework to estimate queue and pub/sub bills: request-based pricing, deliveries/retries, fan-out, and payload transfer (the hidden multiplier).
API Gateway cost optimization: reduce requests, bytes, and log spend
A practical playbook to reduce API Gateway spend: identify the dominant driver (requests, transfer, or logs), then apply high-leverage fixes with a validation checklist.

Related calculators


FAQ

What usually drives serverless cost?
Invocation count and duration are the core drivers, but logs/metrics and networking/egress are common surprises. Downstream services (databases, queues, storage) often dominate the system cost even if compute is small.
How do I estimate quickly?
Estimate monthly invocations, average duration, and average payload size. Then add separate budgets for logs (GB/day) and egress (GB/month), and validate retries/timeouts.
What breaks estimates?
Retry storms, chatty calls to downstream services, and verbose logs during incidents. Also, cold starts and concurrency can change resource usage patterns.

Last updated: 2026-01-22