3 ms·
Way off as in that the Vercel calculation is off? It was a bit hard to find, but I would assume bandwidth in their pricing refers to egress at least. That said
by Tehnix 4y ago
Way off as in that the Vercel calculation is off? It was a bit hard to find, but I would assume bandwidth in their pricing refers to egress at least.
That said, super interesting to see the CloudFlare dropped the egress costs![0] That would make the equation for them probably the most attractive, although that will only be the case as long as you are then not having your CloudFlare Workers talking with e.g. an AWS database which will then just move the egress costs there instead (internal traffic can sometimes be orders of magnitude higher than external).
If you only use it for SSR and only keep whatever SSR is using to offerings within CloudFlare, then it looks to be the most competitive offering for that so far. Your API can still go other places, so little downside there.
One concern I would have, having been quite deep in AWS Lambda, is the 128MB memory limit on CloudFlare workers (unless I misunderstood and it can go higher?). For JS frameworks, that very likely has performance implications, whereas for Rust frameworks, they will be able to perform well within the lower memory limits. Lambda is a bit different though, since the CPU scales with memory, so would be curious if there are any benchmarks on CF Workers with these frameworks?
[0]: https://blog.cloudflare.com/workers-now-even-more-unbound/ https://blog.cloudflare.com/workers-now-even-more-unbound/
- kentonv 4y agoA couple points: 1. Last I checked (admittedly not recently), Lambda throttles CPU proportionally to memory size, e.g. as I recall a 128MB instance is throttled to 1/8 CPU core, 256MB is 1/4, etc. Workers never throttles. 2. The same code running on Workers will use far less memory than when running on Lambda. In fact, the average Worker uses around 3MB RAM. The difference here is that Lambda is counting the memory for the whole runtime process, e.g. a Node.js process, whereas with Workers the runtime is shared with other tenants and only the pure JavaScript heap usage counts against the memory limit. So, 128MB goes further with Workers. That said, obviously some apps need more. At present we don't have a way to increase this limit, but we're working on it. (I'm the tech lead for Workers.)
- mwcampbell 4y agoI wonder if it's feasible to use even less RAM per worker. The pioneers of time-sharing would have considered 3MB per user extravagant. Of course, it practically doesn't matter now, but still, I wonder if it would be feasible to reduce the heap size per isolate by at least one order of magnitude.
- vlovich123 4y agoWay off as in the claim that "edge compute is way more expensive" is only true if you only consider Vercel / AWS Lambda as the universe of edge compute. If you consider Cloudflare Workers pricing, it becomes a lot more competitive. No egress + much lower per request fees + you can choose between per wallclock ms billing and per request billing (different slopes + intersection points). I'm not claiming we're a good fit for every use-case out there. My root point though was about SSR and I think a platform like Cloudflare Workers is perfect for making SSR extremely simple. Disclaimer: Work at Cloudflare. My opinions are my own.