Lambda is used by 65% of AWS customers — more than any other compute service after EC2 (Datadog, 2025). And unlike EC2, you never pay for idle time. No requests? No bill. That makes Lambda the cheapest option for many workloads — until it isn't.
The pricing looks simple: $0.20 per million requests plus $0.0000166667 per GB-second. But the actual bill depends on three variables that interact in non-obvious ways: memory allocation, execution duration, and architecture choice. A Lambda function configured with 3GB of memory costs 24x more per second than the same function at 128MB — even if it only uses 50MB.
TL;DR: Lambda costs $0.20/1M requests + $0.0000166667/GB-second (x86). ARM/Graviton is 20% cheaper. The free tier includes 1M requests and 400,000 GB-seconds per month — permanently, not just 12 months. A function running 1M times/month at 128MB and 200ms average duration costs ~$0.63/month. At 1GB and 1 second, the same million invocations cost ~$16.87.
Lambda Pricing Components
Lambda charges you for three things, and only when your function actually executes:
| Component | x86 Price | ARM (Graviton2) Price | Notes |
|---|---|---|---|
| Requests | $0.20 per 1M | $0.20 per 1M | Same price regardless of architecture |
| Duration (compute) | $0.0000166667/GB-sec | $0.0000133334/GB-sec | ARM is 20% cheaper |
| Provisioned Concurrency | $0.0000041667/GB-sec | $0.0000033334/GB-sec | Pay for reserved capacity |
| Ephemeral Storage | $0.0000000309/GB-sec | $0.0000000309/GB-sec | Beyond the free 512MB |
(AWS Lambda Pricing, 2026)
The pricing formula:
Monthly cost = (requests × $0.20/1M) + (GB-seconds × $0.0000166667)
Where GB-seconds = memory allocated (in GB) × execution time (in seconds) × number of invocations.
The Free Tier: More Generous Than You Think
Lambda's free tier is always free — not just for the first 12 months like EC2 or RDS. Every AWS account gets:
- 1 million requests per month
- 400,000 GB-seconds of compute per month
That's enough to run a small API handling ~33,000 requests per day at 128MB memory for $0/month. For side projects, internal tools, and low-traffic APIs, Lambda can be genuinely free — forever.
What 400,000 GB-seconds means in practice: At 128MB memory and 200ms average duration, you get 15.6 million free invocations per month. At 1GB memory and 1s duration, you get 400,000 free invocations. The memory allocation dramatically affects how far the free tier stretches.
Real-World Cost Scenarios
Abstract per-GB-second pricing is useless without context. Here's what Lambda actually costs for common workloads:
| Workload | Memory | Avg Duration | Invocations/mo | Monthly Cost |
|---|---|---|---|---|
| Webhook handler | 128MB | 200ms | 1M | $0.63 |
| REST API endpoint | 256MB | 500ms | 1M | $4.67 |
| REST API (high traffic) | 256MB | 500ms | 10M | $44.73 |
| Image processor | 1,024MB | 2s | 1M | $33.60 |
| Data pipeline ETL | 2,048MB | 2.5s | 1M | $83.40 |
| ML inference | 3,008MB | 3s | 1M | $167.00 |
Key insight: The cost difference between a light webhook and heavy ML inference is 265x — for the same number of invocations. Memory allocation and execution time are far more important than request volume.
x86 vs. ARM (Graviton2): 20% Savings for Free
ARM-based Lambda functions grew from 9% to 19% adoption in just 2 years (Datadog, 2025). The reason is simple: 20% lower price per GB-second with equal or better performance.
| Architecture | Price per GB-second | 1M invocations (256MB, 500ms) | Savings |
|---|---|---|---|
| x86 | $0.0000166667 | $4.67 | — |
| ARM (Graviton2) | $0.0000133334 | $3.73 | 20% |
For most workloads — Node.js, Python, Java, .NET — switching from x86 to ARM requires changing one dropdown in the Lambda console. No code changes. The function deploys on Graviton2 processors and runs 20% cheaper.
The exceptions: functions with native x86 binaries (compiled C extensions, certain ML libraries) need recompilation for ARM. Test in staging before switching production functions.
Why isn't everyone on ARM? Inertia, mostly. We've migrated dozens of Lambda workloads from x86 to ARM for customers, and 90%+ work without any code changes. The 20% savings is real, recurring, and takes 5 minutes to implement per function.
Provisioned Concurrency: When to Use It
By default, Lambda scales from zero. When a request arrives and no warm instances are available, Lambda creates one — causing a "cold start" that adds 100ms to several seconds of latency.
Provisioned Concurrency keeps functions warm and ready. You pay $0.0000041667/GB-second for the reserved capacity, plus the normal request and duration charges when functions execute.
The Cost of Provisioned Concurrency
| Scenario | Without PC | With PC (10 instances) | Difference |
|---|---|---|---|
| 256MB function, idle 24/7 | $0 | $2.76/month | +$2.76 |
| 256MB function, 1M invocations + idle | $4.67 | $7.43 | +$2.76 |
When it makes sense:
- APIs with latency SLAs under 100ms
- Functions behind API Gateway with real-time user-facing traffic
- Functions that take >5 seconds to cold start (heavy Java/.NET frameworks)
When it doesn't:
- Background jobs, scheduled tasks, event processors
- Functions that tolerate occasional latency spikes
- Low-traffic functions (under 100 invocations/hour)
Lambda vs. EC2 vs. Fargate: When Lambda Gets Expensive
Lambda's pay-per-use model is cheapest at low-to-moderate volume. But at high volume, the per-request cost compounds. Here's the crossover point:
| Volume | Lambda (256MB, 500ms) | EC2 t3.medium | Fargate (0.5vCPU/1GB) |
|---|---|---|---|
| 1M/month | $4.67 | $30.37 | $72.00 |
| 10M/month | $44.73 | $30.37 | $72.00 |
| 30M/month | $132.19 | $30.37 | $72.00 |
| 50M/month | $219.65 | $30.37 | $72.00 |
| 100M/month | $437.30 | $30.37 | $72.00 |
The crossover: Lambda becomes more expensive than EC2 at roughly 30 million requests/month for this configuration. Beyond that, a fixed-cost server wins on pure cost — but you lose auto-scaling, zero-ops, and pay-for-idle advantages.
Our recommendation: Don't optimize purely on cost. Lambda eliminates operational overhead — no patching, no scaling, no monitoring servers. We've seen teams save $200/month switching to EC2 but spend $2,000/month more in engineer time managing the infrastructure. Factor in total cost of ownership, not just compute cost.
7 Ways to Reduce Lambda Costs
1. Switch to ARM/Graviton2
Instant 20% savings. Change one setting in the console. No code changes for most languages.
2. Right-Size Memory
Lambda charges by the GB-second. If your function allocates 1GB but uses 150MB, you're paying for 850MB of wasted memory. Use AWS Lambda Power Tuning to find the optimal memory setting — sometimes more memory means faster execution and lower total cost.
3. Reduce Cold Starts Without Provisioned Concurrency
- Keep functions under 50MB deployment size
- Use lazy loading for dependencies
- Prefer lightweight runtimes (Python, Node.js) over heavy ones (Java, .NET)
- Use SnapStart for Java functions (pre-initializes the JVM)
4. Use Lambda@Edge and CloudFront Functions
If you're processing requests at the edge (authentication, redirects, header manipulation), CloudFront Functions cost $0.10/1M invocations — half the price of Lambda and 6x cheaper than Lambda@Edge ($0.60/1M).
5. Batch Your Invocations
Instead of triggering Lambda once per SQS message, configure batch windows. Processing 10 messages per invocation reduces your request charges by 10x.
6. Use Savings Plans
Compute Savings Plans cover Lambda (not just EC2). If you have predictable Lambda spend, a 1-year Compute Savings Plan can save up to 17% on Lambda duration charges.
7. Monitor with Cost Allocation Tags
Tag Lambda functions by team, project, and environment. Use AWS Cost Explorer to identify which functions cost the most, then optimize those first. Often, 10% of functions drive 80% of Lambda costs.
Frequently Asked Questions
Is AWS Lambda free?
Lambda has an always-free tier: 1 million requests and 400,000 GB-seconds per month — permanently, not just for new accounts. For a small API at 128MB memory handling ~33,000 requests/day with 200ms average duration, Lambda costs $0/month. You start paying only when you exceed the free tier.
How much does Lambda cost for 10 million requests?
It depends entirely on memory and duration. At 128MB memory and 200ms average: ~$4.33/month. At 1GB memory and 1 second average: ~$166.87/month. The same 10M requests can cost anywhere from $4 to $167+ depending on configuration.
Is Lambda cheaper than EC2?
At low-to-moderate volume (under ~30M requests/month for a typical API), Lambda is cheaper AND eliminates server management. Above that threshold, EC2's flat monthly rate becomes cheaper on pure compute cost — but you take on operational overhead. Factor in engineering time, not just the AWS bill.
Does Lambda charge when my function isn't running?
No. Lambda charges only for actual execution time (per-request + per-GB-second of compute). If nobody calls your function, you pay $0. This is the core advantage over EC2 and Fargate, which charge whether or not they're processing requests. The exception: Provisioned Concurrency charges for reserved warm instances.
What's the maximum Lambda execution time?
15 minutes (900 seconds). Functions that exceed this limit are terminated. For longer tasks, use Step Functions, ECS/Fargate, or EC2. If your function consistently runs near 15 minutes, Lambda is probably the wrong tool — and it's costing you significantly more than a container-based solution.
Make Lambda Work for Your Budget
Lambda's pricing model is beautifully simple — and deceptively deep. The same function can cost $0.63 or $167 per million invocations depending on memory and duration. Here's your optimization path:
- Start with ARM — 20% off, zero effort
- Run Power Tuning — Find the optimal memory/cost balance
- Batch SQS processing — Reduce request charges 5-10x
- Monitor and tag — Know which functions drive cost
- Use Wring to catch Lambda waste automatically — we find the savings you're missing




