AWS Lambda vs Cloudflare Workers
One hundred million requests that each take 200 ms and use 10 ms of CPU cost $147.80 on AWS Lambda and $51.40 on Cloudflare Workers. Nothing about the code differs. One vendor bills the waiting.
For a request that waits, Workers is two to three times cheaper and the gap grows with every millisecond you spend on a database call. For a request that works, the two converge, and Lambda's free tier and memory ceiling win back the low end. The bill is a statement about your code's shape, not about the vendors' rates.
- Two vendors, three meters, two definitions of work
- A GB-second is a memory meter wearing a clock
- The bills cross at about 7.5 million requests
- Lambda's second sheet splits the same request in two
- Where Lambda wins on the same sheet
- The exit door has a rewrite behind it
- Cost arithmetic
- Decision matrix
- Migration path
- FAQ
At a glance
| Dimension | AWS Lambda GB-seconds | Cloudflare Workers CPU-ms |
|---|---|---|
| Product foundation | Event Functions bill duration in GB-seconds; Web Functions bill active CPU plus memory | V8 isolates at the edge: CPU time is the only compute meter |
| Pricing model | Event: $0.20/M requests + $0.0000133334/GB-s Arm · Web: $0.30/M + $0.0000276944/vCPU-s + $0.0000036667/GB-s | $5/mo minimum · 10M requests included then $0.30/M · 30M CPU-ms included then $0.02/M |
| Hosting and deployment | No (AWS-managed, VPC and IAM integrated) | No managed equivalent; workerd is open source |
| Runtime and integration | Free tier 1M requests and 400,000 GB-s; 10,240 MB memory ceiling | Free: 100,000 requests/day and 10 ms CPU per invocation; paid: 5-minute CPU ceiling |
| AI-related capabilities | Durable functions at $8 per million operations; streaming priced per GB written | Durable Objects, KV, Queues and Workflows meter separately; static assets are free |
| Lock-in risk | Medium: event sources, IAM and VPC wiring are AWS-shaped | Low on compute, higher on state: Durable Objects hold data inside the product |
| Vendor | AWS Lambda → | Cloudflare Workers → |
1. Two vendors, three meters, two definitions of work
Lambda now publishes two price sheets. Event Functions bill requests plus duration in GB-seconds: $0.0000133334 per GB-second on Arm, $0.0000166667 on x86, and $0.20 per million requests. Web Functions bill active CPU at $0.0000276944 per vCPU-second, memory at $0.0000036667 per GB-second for as long as the environment exists, and $0.30 per million requests.
Workers bill one thing that matters: CPU milliseconds, $0.02 per million after 30 million included, plus $0.30 per million requests after 10 million on a $5 plan. The page is explicit that there is no charge for duration, for egress or for bandwidth.
| Meter | Lambda Event | Lambda Web | Workers |
|---|---|---|---|
| Requests | $0.20/M | $0.30/M | $0.30/M |
| Duration | GB-seconds | memory GB-s, whole life | none |
| CPU | inside duration | $0.0000276944/vCPU-s | $0.02/M CPU-ms |
2. A GB-second is a memory meter wearing a clock
Duration billing multiplies wall time by allocated memory, and both factors are yours to set. A 512 MB function that takes 200 ms bills 0.5 GB × 0.2 s = 0.1 GB-s per request. At 100 million requests that is 10 million GB-seconds, or $133.34 on Arm at $0.0000133334.
Workers bills the 10 ms of actual work instead: 100 million × 10 ms = 1,000 million CPU-milliseconds, which is 970 million after the 30 million included, at $0.02 per million CPU-ms = $19.40.
So the ratio between the two vendors is not a rate difference. It is the fraction of the request that is CPU: 10 ms of 200 ms is 5%, and that 5% is what Workers meters. Make the handler heavier and the gap narrows; make it wait on a database and the gap widens.
3. The bills cross at about 7.5 million requests
Same shape everywhere below: 200 ms duration, 512 MB, 10 ms of CPU, one function.
| Requests/month | Lambda Event (Arm) | Workers | Cheaper |
|---|---|---|---|
| 5M | $0.80 + $1.33 = $2.13 | $5.00 + $0.40 = $5.40 | Lambda |
| 7.5M | $1.30 + $4.67 = $5.97 | $5.00 + $0.90 = $5.90 | Workers, by 7¢ |
| 10M | $1.80 + $8.00 = $9.80 | $5.00 + $1.40 = $6.40 | Workers |
| 50M | $9.80 + $61.33 = $71.13 | $5.00 + $12.00 + $9.40 = $26.40 | Workers |
| 100M | $19.80 + $128.00 = $147.80 | $5.00 + $27.00 + $19.40 = $51.40 | Workers |
The crossover is a free-tier artefact, not a policy: 1 million requests and 400,000 GB-seconds are free on Lambda, and 30 million CPU-ms are free on Workers. Below roughly 7.5 million requests the Lambda allowance is worth more than the CPU savings. Above it, the $5 plan floor disappears into the noise.
4. Lambda's second sheet splits the same request in two
Web Functions are AWS's answer to active-CPU billing, and they price the same 100 million requests differently.
| Line | Lambda Event | Lambda Web | Workers |
|---|---|---|---|
| Requests | $19.80 | $30.00 | $27.00 |
| Compute | 10M GB-s = $128.00 | 1M vCPU-s = $27.69, 1.296M GB-s = $4.75 | 970M CPU-ms = $19.40 |
| Plan floor | — | — | $5.00 |
| Total | $147.80 | $62.45 | $51.40 |
Web Functions bill $62.45 for the same traffic, 42% of the Event price, and still 21% above the Workers bill. The memory meter is why: it bills the environment for its whole life, idle time included, and AWS's own examples quietly assume exactly one environment stays up for the entire month.
5. Where Lambda wins on the same sheet
The free tier, for one. Five million requests a month cost $2.13 on Lambda and $5.40 on Workers, and a hobby project that sends three million costs $2.73 by AWS's own worked example.
Memory ceiling is the second. Lambda allocates up to 10,240 MB per function, which covers a model that will not fit in a V8 isolate. Workers caps a single invocation at 5 minutes of CPU, 30 seconds by default.
The third is everything around the function: VPC access, IAM, SQS, Kinesis, Step Functions and the rest of the event-source catalogue. On an AWS shop, the compute line is frequently cheaper than the integration you would rewrite to leave it.
6. The exit door has a rewrite behind it
Workers runs JavaScript on V8 with a fetch-shaped API. A Lambda handler that imports a native module, spawns a process or needs a writable filesystem does not run there, and the 5-minute CPU cap is not negotiable with a support ticket.
The reverse move is easier and still not free: Workers' egress is $0 and Lambda's is not, so a byte-heavy service that moves back to Lambda picks up a data transfer line it never had.
Price the traffic, not the platform. If your p50 request spends most of its time waiting on a database, the CPU meter is the cheaper meter and the rewrite is the only real cost. If your requests are heavy, synchronous and mostly compute, the two bills converge and the free tier decides.
Cost arithmetic at volume
These are computed from the published unit prices, not measured. Each row prints its own formula, so you can replace our assumption with your traffic and redo it.
Decision matrix
Rows are the situation you are actually in. Pick the row before you read the pricing page again.
| If this is you | Take | Because |
|---|---|---|
| Under about 5 million requests a month | Lambda Event Functions | The 1M-request and 400,000 GB-second free allowances cover the whole job: 5M requests at 200 ms and 512 MB price at $2.13 against $5.40 on Workers. |
| 100 million requests that mostly wait on I/O | Workers | The same shape prices at $51.40 against $147.80, because 10 ms of CPU out of a 200 ms request is all Workers meters. |
| A function that needs 10 GB of memory | Lambda | Lambda allocates up to 10,240 MB; Workers caps a single invocation at 5 minutes of CPU and runs in an isolate with a far smaller footprint. |
| Long-lived streaming to a browser | Lambda Web Functions | Active-CPU billing ignores the wait: AWS's own LLM streaming example prices 5M requests of 3 s at $33.94, against $101.00 as Event Functions. |
| Byte-heavy responses at the edge | Workers | Workers charges nothing for egress or bandwidth, and static asset requests are free and unlimited. |
| SQS, Kinesis, VPC and IAM already wired into the app | Lambda | The compute line is often the small one; rewriting event sources and IAM to leave AWS costs more than the difference on the invoice. |
| A cron job every hour, minutes of CPU each | Workers | Cloudflare's own example prices 720 invocations at 180,000 ms CPU each at $6.99, and duration is not a meter at all. |
| Traffic so spiky that one environment cannot serve it | Lambda Event Functions | Web Functions bill memory for the life of every environment, and the pricing examples quietly assume exactly one environment runs all month. |
Code and configuration
// Event Function: the meter starts at invocation and runs through the wait.
export const handler = async (event) => {
const user = await db.users.findUnique({ where: { id: event.userId } }); // 180 ms here
const digest = render(user); // 10 ms here
return { statusCode: 200, body: digest };
};
// Breaks when: the lookup takes 1 s. You are billed 1.01 s of 512 MB, so the wait
// is 99% of the invoice. Web Functions bill only the 10 ms of active CPU.
// Workers: nothing here is billed by the clock, only the CPU this code burns.
export default {
async fetch(request, env) {
const userId = new URL(request.url).searchParams.get("id");
const user = await env.DB.prepare("SELECT * FROM users WHERE id = ?")
.bind(userId).first(); // 180 ms of waiting, not billed
return new Response(render(user), {
headers: { "content-type": "text/html" },
});
},
};
// Breaks when: render() parses a 5 MB XML feed on every request. CPU is the meter,
// and the 30M CPU-ms allowance is 30 million milliseconds of exactly that.
What you gain, what you give up
AWS Lambda
- Free tier covers a small service outright: 1M requests and 400,000 GB-seconds each month
- Up to 10,240 MB of memory per function, which a V8 isolate cannot match
- Event Functions, MicroVMs, Web Functions and durable functions are all one integration
- The event-source catalogue is the reason teams stay: SQS, Kinesis and Step Functions in one IAM model
- GB-second billing multiplies wall time by memory, so a request that waits still bills
- Web Functions fix the wait but bill memory for the life of every environment, idle included
- Requests cost $0.20/M on Event Functions and $0.30/M on Web Functions, above Workers' $0.30 after 10M included
- Data transfer is metered, so a byte-heavy response is a billable event
Cloudflare Workers
- No charge for duration, egress or bandwidth, which removes the line that surprises AWS bills
- The $5 plan includes 10M requests and 30M CPU-ms, enough for a real product to start
- Static asset requests are free and unlimited, so a Worker-fronted site pays for the API only
- Caching at the edge cuts CPU without cutting the request, and only the request is billed
- A 5-minute CPU ceiling per invocation, 30 seconds by default, with no ticket that lifts it
- The runtime is not a container: native modules, spawned processes and writable disks do not run
- Memory is an isolate-sized budget rather than a configurable 10 GB
- At very low volume the $5 floor is more than Lambda's free tier charges
Migration path
Lambda to Workers is a runtime rewrite: the handler becomes a fetch listener, environment variables become bindings, and anything that needs a native module, a spawned process or a writable disk has no equivalent. State moves to Durable Objects or KV, which bill separately.
Workers to Lambda is smaller but not free: package the code, replace KV and Durable Objects with a database, and accept that egress is metered again. In both directions the traffic analysis comes first, because the arithmetic only favours one vendor when you know the request duration and the CPU share of it.
Common questions
Sources & verification
Prices and limits were read from these pages on 2026-11-10. Vendor marketing claims are quoted as claims. Anything derived is arithmetic on the numbers below.
https://aws.amazon.com/lambda/pricing/
https://developers.cloudflare.com/workers/platform/pricing/
https://developers.cloudflare.com/workers/platform/limits/
https://docs.aws.amazon.com/lambda/latest/dg/snapstart.html
https://docs.aws.amazon.com/lambda/latest/dg/durable-functions.html
Keep reading
Datadog vs Grafana Cloud
The same reading exercise on a monitoring bill: find the unit, then the formula.
Anthropic vs OpenAI API pricing
Two vendors, identical stickers, and the invoice decided by a token count.