Serverless Pricing Comparison

Function-as-a-Service pricing across AWS Lambda, Google Cloud Functions, and Azure Functions. Costs scale with invocation count, execution duration, and allocated memory.

Base Pricing Components

ComponentAWS LambdaGCP Cloud FunctionsAzure Functions
Per invocation$0.20 / 1M$0.40 / 1M$0.20 / 1M
Compute (GB-second)$0.0000166667$0.0000025$0.000016
CPU (GHz-second)Included in GB-s$0.00001Included in GB-s
Memory range128 MB - 10,240 MB128 MB - 32,768 MB128 MB - 14,336 MB
Max timeout15 minutes60 minutes (2nd gen)230 seconds (Consumption)

Free Tier Limits (Monthly)

AllowanceAWS LambdaGCP Cloud FunctionsAzure Functions
Free invocations1,000,0002,000,0001,000,000
Free compute400,000 GB-s400,000 GB-s400,000 GB-s
Free tier typeAlways freeAlways freeAlways free

Monthly Cost Estimates by Invocation Count

Assuming 256 MB memory, 200ms average duration per invocation. Costs after free tier.

Monthly InvocationsAWS LambdaGCP Cloud FnAzure Functions
1 million$0.00$0.00$0.00
10 million$10.55$7.60$10.12
50 million$54.53$39.20$52.32
100 million$109.53$78.80$105.12
500 million$549.53$396.00$528.12

Estimates are approximate. GCP charges separately for CPU (GHz-s) and memory (GB-s). Actual costs depend on memory allocation, duration, and region.

Cold Start and Performance Considerations

Cold Start Latency

Cold starts add 100ms-10s depending on runtime and package size. Java and .NET have the longest cold starts. Python and Node.js are fastest. GCP Cloud Functions 2nd gen uses Cloud Run under the hood, with cold starts typically under 1s for lightweight functions.

Provisioned Concurrency

AWS Lambda Provisioned Concurrency keeps functions warm at $0.0000041667/GB-s (approximately $3/month per instance at 256 MB). Azure Premium Plan provides always-ready instances. This eliminates cold starts but adds a fixed monthly cost.

Networking Costs

Lambda in a VPC no longer incurs extra cold start time (since 2019). However, NAT Gateway costs ($0.045/hr + $0.045/GB processed) for internet access from VPC-attached functions can exceed the function costs themselves.

When Serverless Gets Expensive

At sustained high throughput (above 50M invocations/month with long durations), containers or VMs may be cheaper. The crossover point depends on duration and memory. Functions averaging over 1s with 512+ MB memory become expensive quickly.