How Much Does a Serverless Architecture Cost on AWS, Azure, or GCP?

Serverless functions cost about $0.20 per 1M invocations plus compute time — roughly $83/month in raw compute at 10M invocations. Supporting services like API Gateway and DynamoDB often add 2-5x on top of the function cost itself.

Serverless architectures promise zero idle costs and automatic scaling — but actual costs depend on invocation count, execution duration, memory allocation, and supporting services. AWS Lambda, Azure Functions, and Google Cloud Functions each price differently. Use our calculator to compare serverless costs across all three providers for your workload.

Serverless Pricing Model Explained

Serverless functions charge per invocation (typically $0.20 per 1M requests) plus per-GB-second of compute time. A function using 256 MB RAM running for 200ms costs roughly $0.000000833 per invocation. Sounds cheap — but at 10M invocations/month, that is $83 in compute alone, plus API Gateway costs ($3.50/M requests on AWS), data transfer, and supporting services like DynamoDB or SQS.

When Serverless Is Cost-Effective

Serverless wins for: workloads with less than 1M requests/month (often free tier), highly variable traffic (0 cost at zero traffic), event-driven processing (file uploads, webhooks, scheduled jobs), and prototyping. Serverless loses to containers when: traffic is steady above 5M requests/month, functions run longer than 1 second on average, or you need persistent connections (WebSockets).

Hidden Serverless Costs

The function invocation cost is just the start. Real serverless architectures need API Gateway ($3.50/M requests on AWS), a database (DynamoDB charges per read/write capacity unit), logging (CloudWatch charges per GB ingested), and cold start mitigation (provisioned concurrency costs $0.000004646/GB-second on AWS). These supporting services often exceed the Lambda costs themselves by 2–5x.

Key Cost Factors

  • Functions: Per-invocation and per-GB-second compute
  • API Gateway: Per-request pricing for HTTP endpoints
  • Database: NoSQL (DynamoDB, CosmosDB, Firestore) pay-per-use
  • Queuing: SQS, Service Bus, or Pub/Sub message costs
  • Storage: Event source data and function artifacts
  • Logging: CloudWatch, Monitor, or Cloud Logging ingestion
  • Cold starts: Provisioned concurrency for latency-sensitive paths

Frequently Asked Questions

How much does serverless cost on AWS Lambda vs Azure Functions vs Cloud Functions?

All three charge a similar base rate around $0.20 per 1M invocations plus per-GB-second compute time. A function using 256MB RAM running 200ms costs roughly $0.000000833 per invocation, which adds up to about $83/month at 10M invocations in compute alone. Add API Gateway costs ($3.50/M requests on AWS), data transfer, and supporting services like DynamoDB or SQS, and the real bill is typically 2-5x the raw function cost.

Is serverless cheaper than containers or VMs?

Serverless wins for workloads under roughly 1M requests/month, highly variable traffic, and event-driven processing like file uploads or webhooks, since idle time costs nothing. It loses to containers when traffic is steady above 5M requests/month, functions run longer than 1 second on average, or you need persistent connections like WebSockets. There's no universal cheaper option — it's a function of your traffic shape.

What drives the cost of a serverless architecture?

Per-invocation and per-GB-second compute charges are the visible cost, but supporting services usually dominate the real bill. API Gateway charges per request, NoSQL databases like DynamoDB charge per read/write capacity unit, logging services charge per GB ingested, and provisioned concurrency for cold-start mitigation adds further cost on latency-sensitive paths. These supporting services often exceed the function cost itself by 2-5x.

How accurate are these serverless cost estimates?

Estimates are based on published on-demand list prices for AWS Lambda, Azure Functions, and Google Cloud Functions in US regions, last verified 2026-07-15. Free tier allowances (often the first 1M invocations/month) aren't factored into the baseline comparison, so very low-traffic workloads may cost less in practice than shown. See /methodology for the full calculation approach.

Related resources