Cloudflare Workers vs AWS Lambda cost in 2025: the actual math at scale
AWS Lambda has the ecosystem. Cloudflare Workers has the price. After modelling both for several real workloads, here is the cost math that actually matters.
For most workloads in 2025, Cloudflare Workers is dramatically cheaper than AWS Lambda — anywhere from 3x to 30x depending on the shape of your usage. The question isn’t which is cheaper; it’s when the gap matters enough to drive your choice.
This piece is from modelling actual costs for three real workloads over 2024-2025: a SaaS API at modest scale, a webhook ingest pipeline at high scale, and a multimedia transformation service. The numbers are specific.
The headline pricing in mid-2025
Cloudflare Workers Paid:
- $5/month base
- First 10M requests free
- $0.30 per million requests above 10M
- CPU time: 30M CPU-ms free, then $0.02 per million CPU-ms
- Memory: 128MB per isolate, not separately billed
AWS Lambda:
- Per-request: $0.20 per million requests
- Per-GB-second of duration: $0.0000166667
- ARM Graviton2 pricing is ~20% cheaper than x86
- No fixed base; pure pay-as-you-go
- Tier discounts at high volume
The raw per-request cost looks similar ($0.20 vs $0.30 per million), but duration and memory pricing make Lambda dramatically more expensive at meaningful scale.
Workload 1: SaaS API at modest scale
50M requests/month, average request 100ms CPU time, 256MB allocated memory.
Cloudflare Workers:
- 50M × $0.30/M (above first 10M free) on requests = $12 on requests
- CPU: 50M × 100ms = 5B CPU-ms = $0.02 × (5000 - 30) = $99.40 on CPU
- Subscription base: $5
- Total: ~$116/month
AWS Lambda (x86, 256MB):
- 50M × $0.20/M = $10 on requests
- Duration: 50M × 100ms × 0.25GB = 1.25M GB-sec = $20.83
- Total: ~$31/month
For this specific workload (low CPU per request, low memory), Lambda is cheaper. Cloudflare’s 30M CPU-ms free tier doesn’t cover the CPU work at this scale; you pay the per-CPU-ms rate. Lambda’s memory-time pricing is more efficient for low-memory workloads.
Workload 2: webhook ingest pipeline at high scale
500M requests/month, 20ms CPU per request, 128MB memory.
Cloudflare Workers:
- 500M × $0.30/M = $150 on requests
- CPU: 500M × 20ms = 10B CPU-ms = $0.02 × (10000 - 30) = $199.40 on CPU
- Base: $5
- Total: ~$354/month
AWS Lambda (x86, 128MB):
- 500M × $0.20/M = $100
- Duration: 500M × 20ms × 0.125GB = 1.25M GB-sec = $20.83
- Total: ~$121/month
Still Lambda wins here. The cost story at high request volume with low CPU favours Lambda.
Workload 3: multimedia transformation service
10M requests/month, 800ms CPU per request, 1GB memory (heavy work).
Cloudflare Workers:
- 10M × $0.30/M = $3 (below free tier above 10M)
- CPU: 10M × 800ms = 8B CPU-ms = $0.02 × (8000 - 30) = $159.40
- Workers Unbound for >30s CPU limit may apply at certain percentiles
- Total: ~$167/month
AWS Lambda (x86, 1024MB):
- 10M × $0.20/M = $2
- Duration: 10M × 800ms × 1GB = 8M GB-sec = $133.33
- Total: ~$135/month
These are close. Lambda has a slight edge for the memory-heavy use case.
Where Cloudflare actually wins on cost
The above workloads show Cloudflare losing on raw compute cost. The cost story flips when you include:
Egress bandwidth. AWS charges ~$0.09 per GB for data transferred out of Lambda. Cloudflare charges $0. For any workload serving meaningful data (images, JSON responses, video), this dominates. At 1TB/month egress: AWS $90/month vs Cloudflare $0.
Storage primitives. D1 (SQLite at edge), R2 (S3-compatible, zero egress), KV — all priced sensibly. AWS equivalents (DynamoDB, S3, ElastiCache) are individually fine but billed separately with surprise costs.
No “surprise bill” mode. The 419-upvote r/aws thread “AWS Lambda bill exploded to $75k in one weekend” captures the recurring Lambda anxiety. AWS billing can spike from a misconfigured loop in ways Cloudflare cannot — Cloudflare has request-rate caps and Worker timeouts that prevent runaway costs.
Free tier is real. Cloudflare’s 100K requests/day free tier supports actual production traffic for small SaaS. AWS Lambda’s 1M-requests-per-month free tier is real but the surrounding services (CloudWatch logs, API Gateway, etc.) often blow the budget.
When AWS Lambda wins
Reasons to pick Lambda despite the cost differences:
- You need ecosystem integration — Lambda + SQS + DynamoDB + EventBridge is mature; Cloudflare equivalents (Queues, D1) are newer
- Your team is AWS-trained — sunk cost in expertise is real
- You need specific Node.js / Python features Workers’ runtime doesn’t support
- Compliance / data residency in specific AWS regions
- You have AWS credits to burn through
- The 30-second Workers CPU ceiling matters (Workers Unbound extends but not infinitely)
The actual cost math
For “typical SaaS at modest scale”: AWS Lambda is competitive or slightly cheaper. Don’t assume Cloudflare wins on raw compute cost.
For “high-egress / data-heavy workloads”: Cloudflare wins decisively because of zero egress fees.
For “small projects”: Cloudflare wins on free tier reality.
For “AWS-ecosystem-bound enterprises”: Lambda wins on integration cost.
What r/aws is actually saying
The community signal in mid-2025:
- The $75k bill thread (419 ups) is the canonical “AWS surprise bill” reference. Heavy lessons about budget alarms and concurrency limits.
- Free AWS cost scanner (327 ups) — “$10K-30K/year typical savings” — speaks to ambient AWS cost waste
- Recurring “should I move to Cloudflare?” threads — the answer is “it depends on egress and your team’s comfort zone”
The recommendation
Run the actual numbers for your specific workload. The shape (request count, CPU per request, memory, egress volume) matters more than the headline rates.
If you’re egress-heavy: Cloudflare. If you’re compute-heavy at high scale: Lambda still wins on raw $/CPU. If you’re a small team / side project: Cloudflare’s free tier and predictable billing are the real value.
For TopInsight we’re on Cloudflare Workers entirely. Egress dominates our cost profile (we serve content), the bill predictability matters, and the unified platform reduces ops surface. For different workload profiles, the answer would be different.
See our Workers vs Vercel comparison for the other edge platform contender, and Workers + D1 production guide for the broader stack pattern.
Sources
Every reference behind this piece. If we make a claim, it's because at least one of these said so — or we lived it ourselves.
- Firsthand Modelled both platforms for three real workloads in 2024-2025
- Docs Cloudflare Workers pricing — Cloudflare
- Docs AWS Lambda pricing — AWS
- Blog r/aws — AWS Lambda bill exploded to $75k thread (419 ups) — r/aws
- Blog r/aws — Free AWS cost scanner thread (327 ups) — r/aws
- YouTube AWS vs Cloudflare cost analyses by ThePrimeagen, Theo, others — Various