Live data from Hacker News

Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

blog.cloudflare.com

21–30 of 65 posts

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#21
post #6

Comparing Workers to Lambda proper seems silly. Lambda lets you connect to DBs, use a lot more than 128MB of memory, etc, etc, etc. Comparing them to Lambda@Edge makes sense, but Lambda@Edge is not a very good product. (Full disclosure: my company competes with Cloud Flare Workers).

Could you expand on your opinion of Lambda@Edge? For my company's needs, it has worked superbly.

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#22
post #4

Have you think about including Golang based Lambda function in your benchmark? As you're guessing that Cloudfare superior JS runtime plays a big role, it could be interesting to see if it can compete against Golang Lambda as well.

A lot of our performance benefit comes from lighter-weight sandboxing using V8 instead of containers, which makes it feasible for us to run Workers across more machines and more locations. It wouldn't surprise me too much if a Worker written in JS can out-perform a Lambda written in Go, as long as the logic is fairly simple. But I agree we should actually run some tests and put up numbers... :)

On another note, currently we only support JavaScript, but we're putting the finishing touches on WebAssembly support, which would let you run Go on Workers... stay tuned.

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#23
What Infrastructure as Code (IaC) options exist for Cloudflare Workers? AFAICT neither Serverless nor Terraform support it. IaC is table stakes for any new part of my tech stack, and I would prefer not to code it from scratch - unless deployment/configuration is extremely easy to automate via CLI or something...

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#24
post #23

What Infrastructure as Code (IaC) options exist for Cloudflare Workers? AFAICT neither Serverless nor Terraform support it. IaC is table stakes for any new part of my tech stack, and I would prefer not to code it from scratch - unless deployment/configuration is extremely easy to automate via CLI or something...

There's a Terraform provider for Cloudflare [1]. There's an issue for adding support to Serverless [2], please feel free to thumbs_up.

[1] - https://github.com/terraform-providers/terraform-provider-cl...

[2] - https://github.com/serverless/serverless/issues/4948

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#25

Can we see the code that was used for testing Lambda and Workers?

Yes! https://github.com/cloudflare/worker-performance-examples/tr...

Any plans to publish the results from the pbkdf2 version?

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#28
post #8

>To be fair, comparing my Lambda, which only runs in us-east-1 (Northern Virginia, USA), to a global service like Workers is a a little unfair. At least you acknowledge that it's a bit silly to use a global benchmark to compare a global service with an intentionally-regionalized service.

Why would you run something in a single location if you can run it everywhere for the same price though? It's not like Lambda is cheaper for being centralized.

Isolating failure domains and complying with data residency requirements are a couple reasons. Also, global reach usually means global blast radius if you screw something up.

For the specific use case you tested workers on the edge absolutely make more sense than lambda, but I think the headline is a bit click-baity.

Re: Serverless Performance: Cloudflare Workers, Lambda and LambdaEdge

#29
post #26

> The functions being tested simply return the current time Not a very interesting benchmark. This would only measure net latency and spin-up time.

I have a post which should come out later in the week which dives into the performance with CPU-intensive workloads. tl;dr is that a 128MB Lambda is about 8x slower than a Worker.
Post reply on HN