Free ToolBy GitIntel

Serverless Cost Estimator: AWS Lambda, Cloudflare Workers, Vercel Edge

Serverless pricing looks cheap on paper and surprises teams at scale

GitIntel tracks AI-generated code across your entire git history — giving every tool on this page the attribution layer that standard dev tooling misses.

Try GitIntel free

Serverless pricing looks cheap on paper and surprises teams at scale. Understanding the billing model before you commit prevents architecture regrets.

AWS Lambda charges on three dimensions: requests ($0.20 per million), compute ($0.0000166667 per GB-second), and data transfer (first 1GB free, then $0.09/GB out to internet). A function that runs 1M times/month at 200ms average duration with 512MB memory costs: $0.20 (requests) + $0.0000166667 × 0.2 × 0.5 × 1,000,000 = $1.67 (compute) = ~$1.87/month. That's genuinely cheap. Add a 5TB daily data pipeline and the math changes.

Cloudflare Workers charges $5/month for 10M requests (Workers Paid), then $0.30 per additional million. CPU time is capped at 30ms per request on free, 50ms on paid. Workers have no cold starts (V8 isolates vs containers), making them ideal for latency-sensitive edge logic. Cost advantage over Lambda at high volumes: Workers at 100M requests = $32; Lambda at 100M requests (100ms, 512MB) = ~$103.

Vercel charges per function invocation for non-Edge functions. Edge Functions run on Cloudflare's network and are billed like Workers. The Vercel overhead is convenience: automatic deploys, preview URLs, and Next.js integration. At high scale, the markup over raw Cloudflare becomes significant.

The crossover point where containers beat serverless: sustained workloads above ~70% CPU utilization. A 1 vCPU container at $20/month handling 2M requests is cheaper than Lambda for any function running >300ms average. Serverless wins for bursty, unpredictable, low-average workloads.

Frequently Asked Questions

What's a serverless cold start and how do I prevent it?

A cold start is the latency (50-3000ms) that occurs when a serverless function is invoked after being idle and needs to initialize its runtime container. Prevention options: Lambda Provisioned Concurrency (keeps instances warm, costs ~$15/month per function), using Cloudflare Workers (V8 isolates have sub-5ms cold starts), or keeping functions warm with scheduled pings every 5 minutes.

Is serverless cheaper than a VPS for a small API?

For under 1M requests/month, serverless is almost always cheaper. A DigitalOcean Droplet at $6/month is idle most of the time but always charging. Lambda at 500K requests (200ms, 512MB) costs under $0.50/month. The break-even for steady-state workloads is typically 5-20M requests/month depending on function duration.

Can serverless handle database connections?

Raw database connections (PostgreSQL, MySQL) are problematic in serverless because each function instance opens a new connection, exhausting the database's connection pool at scale. Solutions: use a connection pooler (PgBouncer, Supabase's pgbouncer, RDS Proxy), or use a serverless-native database (PlanetScale, Neon, Turso) that accepts HTTP connections rather than persistent TCP.

Start Using GitIntel Free

Open source. No account required. Works on any git repository.