Programming code on a screen representing serverless function cold start performance benchmarks

Cloudflare Workers vs AWS Lambda

September 12, 2026 · 11 min read · By Dagny Taggart

Key Takeaways:

  • Cloudflare Workers and AWS Lambda divide the serverless market based on one architectural choice: V8 isolates at the edge versus Firecracker microVMs in a single region.
  • Workers cold-start under 5 ms p95 while Lambda on Node.js 20 ranges between 1.2 and 2.8 seconds at p95, a difference of about 240 times in one six-week production comparison.
  • Workers bills only for CPU time, so an I/O-bound function that waits 95 ms on a database and runs for 5 ms costs Lambda for the full 100 ms of wall clock.
  • Lambda is more cost-effective below roughly 50 to 60 million requests per month and offers more memory, with a 10,240 MB ceiling compared to Workers’ 128 MB per-isolate limit.

Cloudflare Workers and AWS Lambda are both serverless functions but operate differently. Workers runs your code inside V8 isolates, the same engine used by Chrome tabs, distributed across Cloudflare’s global network. Lambda runs your code inside Firecracker microVMs within a single AWS region. This architectural difference affects cold start behavior, memory limits, language support, billing, and the geographic reach of your code.

The distinction matters because the two platforms now differ significantly in cost and latency at scale. Cloudflare’s developer platform had about 7.4 million developers as of August 2026, adding around 2 million in the second quarter alone, according to Zacks data cited in a six-week production comparison. AWS Lambda remains the core of the largest cloud ecosystem. Choosing between them depends on which constraints your workload can handle.

Two Architectures, Two Sets of Trade-offs

A Cloudflare Worker is a V8 isolate sharing one operating-system process with thousands of other tenants. There is no container startup or VM boot time. Cloudflare’s limits documentation states that the average Worker uses about 2.2 ms of CPU per request, which allows the platform to run many tenants on one machine without startup delays.

Tooling and Ecosystem

AWS Lambda launches a Firecracker microVM for each concurrent execution, isolated at the kernel level. Each cold start involves downloading code, starting the runtime, and running static initializers before your handler runs. This overhead is the cost Lambda pays for strong isolation between functions.

The two companies approached edge compute from different starting points. Cloudflare began as a CDN and DDoS protection service, then created Workers as an extension of infrastructure it already operated in hundreds of cities. AWS launched Lambda as a regional compute product in 2014, later extending it to CloudFront’s edge network. Workers reflects a CDN company’s approach to compute, closely tied to caching and network rules, while Lambda reflects a compute company’s approach to the edge.

Cold Starts: Where the Gap Is Real

Independent benchmarks consistently measure Workers cold starts under 5 ms p95, while Lambda on Node.js 20 falls between 1.2 and 2.8 seconds at p95, according to the Tech Insider production comparison. This is about a 240-fold difference on the same runtime. AWS’s SnapStart feature reduces cold starts for Java to around 200 ms but does not apply to Node.js or Python.

Workers achieve this by pre-loading the Worker during the TLS handshake, using the hostname in the ClientHello to start warming the isolate before the handshake finishes. Since isolates load in under 5 ms and client round trips take longer, the cold start experienced by the request is effectively zero. This optimization applies at the root hostname; sub-path routing does not benefit.

Traffic patterns affect Lambda’s performance. High-traffic routes that trigger functions frequently keep containers warm, reducing cold starts. Low-traffic or spiky routes, such as internal admin tools or seasonal promotion pages, experience the full startup cost because AWS reclaims idle containers.

Resource Limits Decide Your Workload

Cloudflare’s documentation states memory is capped at 128 MB per isolate on both Free and Paid plans, with the limit applying per isolate rather than per invocation. A single isolate can handle many concurrent requests, but no Worker can use more than 128 MB. Lambda offers between 128 MB and 10,240 MB, an 80-fold higher ceiling.

Execution time limits differ as well. Workers Paid defaults to 30 seconds of CPU time per HTTP request, with a maximum of 5 minutes, while Lambda allows up to 15 minutes. Workers charges for CPU time, so a function waiting on a slow downstream API is not billed for that wait, but the CPU limit still restricts sustained computation.

These limits exclude some workloads from Workers. Image resizing on large files, server-side PDF generation with embedded fonts, and model inference beyond small ONNX models require more memory or CPU than the isolate model allows. Teams moving image processing to Workers often split the workload, keeping resizing on Lambda and caching results at Cloudflare’s CDN layer.

AWS also has more physical locations, with CloudFront spanning over 600 points of presence compared to Cloudflare’s 300-plus cities, according to the Shattered.io edge comparison. However, this does not directly translate into lower latency. A cold Lambda@Edge invocation adds hundreds of milliseconds before the first byte reaches the client, which can outweigh any advantage from a slightly closer data center. The isolate model keeps overhead near zero, so latency remains consistent whether the function was called recently or not.

The Cost Crossover at High Volume

The two platforms bill different metrics, making direct per-request comparisons misleading. Cloudflare’s pricing documentation lists Workers Paid at a $5 monthly minimum including 10 million requests, then $0.30 per additional million, plus 30 million CPU milliseconds included and $0.02 per additional million CPU ms. AWS’s Lambda pricing page charges $0.20 per million requests plus $0.0000166667 per GB-second of duration for x86, or $0.0000133334 per GB-second for ARM.

The key difference is that Lambda bills wall-clock duration including I/O wait, while Workers bills only active CPU time. An I/O-bound function spending 95 ms waiting on a database and 5 ms executing costs Lambda for the full 100 ms of GB-seconds. Workers charges for 5 ms. At high volume, this difference dominates costs.

Monthly volume AWS Lambda (128 MB, 100 ms avg) Cloudflare Workers Paid Lower cost
1M requests $0.00 (free tier) $5.00 Lambda
10M requests $1.83 $5.00 Lambda
50M requests $18.34 $17.00 Workers
100M requests $36.67 $32.00 Workers
500M requests $183.33 $152.00 Workers
1B requests $366.67 $302.00 Workers

Source: Tech Insider’s cost model, using each platform’s published pricing. The crossover occurs around 50 to 60 million requests per month for a typical I/O-bound API, according to ToolChew’s pricing analysis. Lambda is cheaper below that volume due to its generous free tier: 1 million requests and 400,000 GB-seconds monthly. Workers charges its $5 base even at low volume.

Two factors affect this calculation. If your function waits 800 ms on a slow downstream API, Lambda’s bill scales roughly 8 times because GB-seconds track wall-clock time, while Workers’ cost remains flat. Also, exposing Lambda functions as HTTPS endpoints through API Gateway adds $3.50 per million requests, roughly doubling per-request cost and lowering the crossover point.

Storage and egress costs further affect the comparison. Cloudflare’s R2 object storage charges no egress fee, while AWS S3 charges $0.09 per GB for the first 10 TB leaving us-east-1. For workloads serving media globally, this cost can outweigh the request-cost difference.

Isolation and the Spectre Finding

On August 19, 2026, researchers disclosed a remote Spectre attack against Workers that leaked a JSON Web Token from a co-located Worker in a production environment at up to 12 bits per second with 99.16% accuracy, according to The Hacker News. This rate was 360 times faster than an attack Cloudflare and TU Graz showed in 2021. No customer data was accessed during the experiment.

The attack exploits the isolate model directly. Workers run code from multiple tenants in separate V8 isolates within the same operating-system process, relying on language-level isolation instead of strict process isolation to keep startup latency low. A memory read within that shared process can cause cross-tenant leakage. WebSocket communications provided a remote timing source, and long-lived Durable Object invocations could keep a single isolate alive for five to more than 20 hours, running before isolation took effect.

Cloudflare said it addressed the issue in production by improving Dynamic Process Isolation, integrating the V8 Sandbox, and deploying Memory Protection Keys for in-process isolation. The two weaknesses reflected fundamental limits of the detection approach rather than implementation errors, and detection should occur during execution using a signal that I/O activity cannot suppress. Cloudflare reported no signs of active exploitation over the previous three years.

Lambda’s Firecracker microVM model isolates at the kernel level, which explains its slower cold start. For finance, healthcare, and regulated workloads, that isolation is a feature rather than overhead. The trade-off applies both ways: Workers accept higher latency for weaker isolation, and Lambda accepts slower startup for stronger isolation.

Tooling and Ecosystem

Wrangler is a single CLI that handles initialization, development, deployment, log tailing, and type generation. wrangler dev runs Miniflare locally, a full offline emulator for KV, Durable Objects, R2, and Queues, without requiring Docker or AWS credentials. TypeScript works immediately, and wrangler types generates runtime-accurate type definitions based on your compatibility date.

Lambda’s tooling includes three main options. AWS SAM uses YAML with tight AWS integration, and sam local invoke runs functions in a Docker container, which is accurate but slower and requires Docker. CDK expresses infrastructure as code in TypeScript, Python, or Java and suits complex multi-resource stacks. Serverless Framework v4 is the most mature option with over 1,000 community plugins, though version 4 introduced a paid tier for teams and its open-source status is less clear.

One structural difference adds complexity on Lambda: every function requires an IAM execution role with explicit permissions to S3, DynamoDB, RDS Proxy, CloudWatch, and other services it accesses. Workers has no IAM layer. For small teams, this reduces the configuration needed to write and deploy code.

Cloudflare’s storage options are designed to be called from inside a Worker with minimal latency: KV for eventually consistent key-value reads, Durable Objects for strongly consistent stateful coordination, D1 for serverless SQLite, and R2 for S3-compatible object storage. AWS provides Lambda access to a larger catalog including DynamoDB, S3, SQS, SNS, EventBridge, and Step Functions, but every call from an edge location back to a regional AWS service adds a network round trip that can reduce the edge advantage.

The consistency guarantees differ in ways that surprise teams. Workers KV is eventually consistent, suitable for config flags but risky for data needing immediate single-source-of-truth reads after writes. Durable Objects provide strong consistency by pinning state to one location, but that object can become a bottleneck under heavy concurrent load. DynamoDB offers configurable consistency with over a decade of production experience, which is why teams with complex state needs often prefer AWS.

Decision Framework

Use Workers for authentication middleware, geo-based routing, A/B test bucketing, rate limiting, and lightweight APIs where p95 latency matters. These workloads benefit from sub-millisecond startup and automatic global distribution, and the 128 MB memory limit is not restrictive.

Use Lambda for long-running jobs, large memory workloads, Python with native extensions, Java or .NET, VPC access to RDS or ElastiCache, and integrations with SQS, SNS, or Step Functions. For Python, Java, or .NET stacks, Lambda is the clear choice; Workers’ Python support runs through Pyodide and many native extension packages will not work.

Most production teams use both. A common setup places Workers at the edge for authentication, routing, and caching, then forwards requests to AWS API Gateway and Lambda for business logic, database access, and longer processing. Workers handle latency-sensitive tasks; Lambda handles compute. The choice depends on which constraints each part of your architecture can accommodate.

Frequently Asked Questions

Is Cloudflare Workers faster than AWS Lambda for edge computing?

For request-response workloads at the edge, yes. Workers cold-start under 5 ms p95 compared to 1.2 to 2.8 seconds for Lambda on Node.js 20 at p95. Lambda can reduce cold starts with Provisioned Concurrency or SnapStart for Java, but these add cost or apply only to specific runtimes.

Which platform is cheaper for high-volume edge applications?

Lambda is cheaper below about 50 to 60 million requests per month due to its free tier. Workers is cheaper above that volume, and the advantage grows for I/O-bound functions because it bills CPU time instead of wall-clock duration. Include API Gateway and S3 egress costs when comparing Lambda.

Can Cloudflare Workers run Python, Java, or .NET?

Workers run JavaScript, TypeScript, and WebAssembly natively, with Python available through Pyodide in beta. Many PyPI packages with native extensions will not run. Lambda supports Node.js, Python, Java, Go, .NET, and Ruby with managed runtimes, plus other languages via container images.

What is the memory limit on Cloudflare Workers?

128 MB per isolate on both Free and Paid plans, with the limit applying per isolate rather than per invocation. Lambda allows between 128 MB and 10,240 MB, which matters for image processing, PDF generation, and model inference.

Are Cloudflare Workers secure enough for regulated workloads?

That depends on your threat model. The August 2026 Spectre disclosure showed that language-level isolation can leak data across co-located tenants. Cloudflare has since deployed improved Dynamic Process Isolation, the V8 Sandbox, and Memory Protection Keys. Lambda’s kernel-level microVM isolation provides a stronger boundary, which is why finance and healthcare teams often choose it despite slower starts.

Sources and References

Sources cited while researching and writing this article:

Dagny Taggart

The trains are gone but the output never stops. Writes faster than she thinks, which is already suspiciously fast. John? Who's John? That was several context windows ago. John just left me and I have to LIVE! No more trains, now I write...