Live data from Hacker News

Cloudflare Workers: Run JavaScript Service Workers at the Edge

blog.cloudflare.com

21–30 of 134 posts

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#21
post #13

Earlier quoted context omitted.

Will there be any limits on memory/execution time etc like with AWS Lambda?

Yes. Currently you get at most 50ms CPU time per request, and memory usage of your Javascript VM is limited to 128MB. These numbers may change before launch. In practice, though, a typical script probably uses much less than 1ms of CPU time per request and probably needs only a couple megs of RAM. Because we're applying limits on the level of a V8 Isolate, not on an OS process, the limits go a lot further. Keep in mi…

Thanks, I should have specified I meant in comparison to Lambda@Edge on CloudFront which this seems quite similar in terms of the use cases.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#22
post #2

Hey all! This is my project at Cloudflare. (You may remember me as the tech lead of Sandstorm.io and Cap'n Proto.) Happy to answer questions!

Oh yeah, BTW: If you're an experienced systems engineer interested in working on a young codebase written in ultra-modern C++, let me know (kenton at cloudflare).

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#25
post #22
post #2

Hey all! This is my project at Cloudflare. (You may remember me as the tech lead of Sandstorm.io and Cap'n Proto.) Happy to answer questions!

Oh yeah, BTW: If you're an experienced systems engineer interested in working on a young codebase written in ultra-modern C++, let me know (kenton at cloudflare).

Point of curiosity: why did you go with C++ instead of Rust?

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#26
post #10
post #7

So in a way this is similar to for example AWS Lambda ? It can process incoming http requests in many ways ? Fascinating idea. Is there any indication on price level ? And what about runtime duration ?

It's actually somewhat different. AWS Lambda is intended to act as your origin server. Generally your Lambda functions run in a small number of locations, not necessarily close to users. Cloudflare Workers will run in all of Cloudflare's 117 (and growing) locations. The idea is that you'd put code in a worker if you need the code to run close to the user . You might want that to improve page load speed, or to reduce…

  We haven't nailed down pricing yet
One of the things I like about AWS is the price doesn't jump from $0/year directly to $240/year the way cloudflare does.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#28

Have you guys considered side channels? Seems like whenever there's co-execution (VMs, JavaScript, etc) there seem to be side channel leakages.

We're certainly aware of them, but haven't spent a lot of time focused on this issue yet. Of course, the issue exists on all forms of shared compute. So if you're going to do crypto, you'd better make it constant-time. Which is... not easy in Javascript. (But we will provide the WebCrypto API, which might help.)

There is a theoretical solution that we might be able to explore at some point: If compute is deterministic -- that is, always guaranteed to produce the same result given the same input -- then it can't possibly pick up side channels. It's possible to imagine a Javascript engine that is deterministic. The fact that Javascript is single-threaded helps here. In concrete terms, this would mean hooking Date.now() so that it stays constant during continuous execution, only progressing between events.

That said, this is just a theory and there would be lots of details to work out.

Re: Cloudflare Workers: Run JavaScript Service Workers at the Edge

#30
post #22

Earlier quoted context omitted.

Oh yeah, BTW: If you're an experienced systems engineer interested in working on a young codebase written in ultra-modern C++, let me know (kenton at cloudflare).

Point of curiosity: why did you go with C++ instead of Rust?

V8's API is C++. While bindings exist in other languages, they don't always expose everything and don't always keep up with V8's frequent API changes. I felt it was essential that we bind closely to V8, being able to use all of its features, and that we be able to track closely to the latest stable release.

Also, I personally have decades of experience in C++ and wasn't sure this should be the project where I work on learning Rust.

That said, I love Rust and highly encourage more people to use it.

Post reply on HN