127 points HatchedLake721 4 days ago 122 comments
hbcondo714 4 days ago | parent
But cold starts could still occur, especially in a low-traffic environment where requests come in seldomly?
jazzypants 4 days ago | parent
> Lambda scales down to zero environments when there is no traffic. The next request after that starts a new environment (a cold start).
https://docs.aws.amazon.com/lambda/latest/dg/web-functions-s...
squiwardStan5 4 days ago | parent
fulafel 3 days ago | parent
There was also this a week ago, maybe you can combine this with containers? https://aws.amazon.com/blogs/compute/get-started-with-aws-la...
HatchedLake721 3 days ago | parent
fulafel 3 days ago | parent
tkcranny 4 days ago | parent
Lucasoato 3 days ago | parent
AbstractH24 3 days ago | parent
But maybe I'm dumb or missing something.
HatchedLake721 4 days ago | parent
Imustaskforhelp 4 days ago | parent
Cloudflare workers wasn’t always an 1:1 option for simple hosting (iirc) and people used to think it was more complicated than vercel etc but it has changed in recent years and right now they have made things smoother and simpler to compete with vercel and others.
Now that AWS has entered into the field as well, given that vercel and others already build on top of AWS. It will be interesting to see how this all goes.
I wonder if more og hyper scalers like say hetzner/ovh and others will also target this audience
pjmlp 2 days ago | parent
Render also doesn't require pay for play.
This is something that big hyperscallers are yet to understand, free to play and then one is hooked, it is much easier to go to the next step.
Imustaskforhelp 2 days ago | parent
"Hosting a hobby project for free without credit card is tough (rant) & here's how I did it (Hugging face)"[0]
I remember trying to evaluate all the options and trying to find a good enough option and there were very few options aside from Vercel and Render or rewriting your application to fit cloudflare workers.
HF spaces is a good option that I had found back then. Also, I recommend having a separate backend service like supabase with HF as if your server is inactive for 24-48 hours, the storage could get wiped out so backend should be seperated.
One of the biggest things that I am proud of was how I broke the nat of intel tiber jupyter using applying a custom patch of bearssh and before it, using junest and ssh and ppng.io, all because I wanted to play minecraft with my friend without credit card :-D
Nowadays, I have a few cheap vps's which makes things so much simpler but I remember that struggle and vercel/render used to help in most cases thus they are so popular.
So I seriously agree with what you are saying based on my experience as well. Though I have to wonder?: I think that the reason that small companies aren't attempting this is because of reasons of scam/spam, but what reasons are there for AWS and others to not do so.
What are the reasons that you think that they don't already provide such service, or do you feel as if this is the natural continuation of it and soon we are gonna see AWS or large hypercloud provider providing free very small compute similar to vercel/render?
Also thanks for making me remember again the blog that I had written :-D
[0]: https://smileplease.mataroa.blog/blog/hosting-a-hobby-projec...
pjmlp 2 days ago | parent
Whereas Vercel, Render and co, got to offer such accounts for free due to VC money and trying to get people on board, while fighting against the big names for customer eyes.
Imustaskforhelp 2 days ago | parent
I remember reading about vercel trying to move away from AWS or railway successfully doing so. Their long term end goal still is to migrate away from AWS to capture more juicy margins (or is it? Vsauce music plays)
So with that in mind, has AWS and others realized that providing free credits would be more disruption to actual people paying right now and more loss than whatever Vercel is fighting for?
And if that's the case, then to the investors funding Vercel... Do they know that as well?
Also, I think Vercel has gotten to the point where they are handling spam good-ish but the other alternative railway (not entirely free without credit card yes but still an alternative) still relied on GCP (yes even after their migration/colocation) and GCP's opaque black structures shut down all of railways because of a few accounts doing something malicious.
That is the cost of doing business on someone's else computers and also suppose somebody is creating a new vercel competitor, then they are intentionally targeting themselves as a free alternative and are gonna get free users who intentionally might not pay while facing spam/scam/reputation issues and would need constant maintanence and support. (For example: a guy X creates a scam site targeting Y company at this new Z vercel alternative, the Y company has to contact Z and Z will contact it back and Z has to fix the issues X caused, and there are many more X than what Z can handle)
I am more-so interested though that if Vercel is really a great idea (lure free users etc.) then why aren't others trying the same now and flooding free compute. Is it that the investors who wish to invest in such companies would have better returns in investing in Vercel anyway and have better chances in beating the traditional hyperscalers over establishing a new competitor over Vercel and then over AWS etc.?
If we were to try to arrive at an conclusion or for me to try to learn something new, what could it be?:
Is it that AWS/GCP/Azure are intentionally not becoming a Vercel alternative because they can get away by doing so and its more profitable for them to do so?, and that it's not profitable or even possible for others to do so as well unless they have deep pockets to burn through.
ZiiS 4 days ago | parent
paduc 4 days ago | parent
Exciting times, I can’t wait for Cloudflares response.
CharlieDigital 4 days ago | parent
Both allow deployment of web apps without an adapter layer. Both scale to zero (really useful for hobby apps; small internal apps that do not get sustained traffic, but can get bursty). Both allow concurrency control.
Cloud Run "family" is quite a nice way of managing serverless ("orchestrationless"?) containers. Cloud Run worker pools for background workers that connect to Pub/Sub. Cloud Run jobs for long running tasks like extracts, ETL. Cloud Run instances (newer offering) for always on agents.
mikeocool 4 days ago | parent
I believe Cloudflare is the only FaaS that offers that. It makes it fantastic for putting a light weight layer in front of a few upstream API, like say inference providers.
syrusakbary 4 days ago | parent
Wasmer also offers the same (charging only for active CPU usage), with the advantage that you can run full Node.js and Python workloads
jasonjmcghee 4 days ago | parent
And the maximum worker time is based on processing time, not wall time.
chrismustcode 3 days ago | parent
dzonga 4 days ago | parent
what will be interesting to see is startup times.
AznHisoka 4 days ago | parent
felixgallo 4 days ago | parent
kentonv 4 days ago | parent
V8 isolates seem "worse" on their face (e.g. mostly incompatible with non-JS apps, more difficult to secure), while aiming down-market. The hyperscalers' biggest existing customers aren't asking for them; they are asking for more and better micro VMs to run their existing codebases. It's only the little guys looking to deploy greenfield apps with low ops overhead and on a tight budget that really appreciate the Workers model, and to AWS these seem like small potatoes. Meanwhile there's a huge amount of investment needed to build out this entirely new and different way of doing things (we've been working on it almost a decade now!). In the worst case, this investment is wasted, and in the best case, cannibalizes the existing product line.
There likely many people at AWS who recognize the dilemma, but still cannot push the organization in the right direction. Too much inertia, too many stakeholders who don't get it, because it's unintuitive. When orgs get big they just cannot take disruptive steps, even when they were built on disruption in the past. They only finally come around after the new disruptor is eating their lunch, but by then it's too late.
cowlevel 4 days ago | parent
Callumk77 4 days ago | parent
kichik 4 days ago | parent
cowlevel 4 days ago | parent
kichik 4 days ago | parent
oblio 4 days ago | parent
kichik 4 days ago | parent
chaz6 4 days ago | parent
bob1029 4 days ago | parent
Everything about running software is made more difficult this way. You might think it would make certain infrastructure aspects easier, but it just changes the semantics of the same problem. It's the same quantity of mess to clean up, but now it's in these really weird piles that are often much harder to access.
> up to 128 concurrent requests per environment
I am fairly confident I could support more capacity with a single t3a.nano instance.
vermilingua 4 days ago | parent
My guess is that the IaC is the special sauce that's missing; you do need to go all in with some IaC solution to make using Lambda easy, but it doesn't take a lot of it to make it slick.
Cost/compute is obviously strictly worse for FaaS, but most web workloads don't _really_ need to be optimal.
CharlieDigital 4 days ago | parent
No adapters needed; just write a web API and ship it. Public URL gets assigned and its ready for use. Code works locally with no special adapters, emulators, or tooling needed. Need to support another cloud plat tomorrow? Ship the same container. Moving it to self-managed K8s? Same container.
happymellon 3 days ago | parent
AWS has Fargate which does the same thing if you are building containers.
https://sliplane.io/blog/comparing-prices-aws-fargate-vs-azu...
CharlieDigital 3 days ago | parent
icedchai 3 days ago | parent
CharlieDigital 3 days ago | parent
badatnames 4 days ago | parent
ryandvm 4 days ago | parent
That particular use case can go from hardly any traffic at all to a hurricane of traffic during something like, well, a hurricane.
For consistent processing loads, I think I could save money by just running on dedicated EC2 instances, but you cannot beat the instant scale of Lambdas.
Shameless plug: https://play.google.com/store/apps/details?id=app.radarlove....
CharlieDigital 4 days ago | parent
Specify the maximum number of allowed instances and maximum concurrency per instance. Optionally configure more targeted scale rules. It will scale it from 0 - n as needed.
[0] https://docs.cloud.google.com/run/docs/about-instance-autosc...
[1] https://learn.microsoft.com/en-us/azure/container-apps/scale...
badatnames 4 days ago | parent
CharlieDigital 4 days ago | parent
Indeed if you configured each instance as a single threaded handler, you will not have fun.
badatnames 4 days ago | parent
CharlieDigital 3 days ago | parent
> In your scenario, every request is hitting either an overloaded instance,
Why would this be the case? Cloud Run containers and an app runtime like .NET, Java, Go, Rust can inherently be multi-threaded, multi-connection. It can handle up to 1000 concurrent connections per container using just threads and async (assuming sufficient size). Any workload that requires hitting the DB or backend service (S3, etc) is going to I/O bound and sitting in a future most of the time anyways.The container instances auto-scale by default to a configured n (0 - n) with the option to define specific scale points. If I'm sensitive to high bursts, this can be a matter of scaling at 50% capacity and a warm instance is available while the application still has headway.
Cases where this falls apart: DDoS in which case, I argue that 1) it is better in any case that it falls apart rather than absorbing that type of traffic spike, 2) such traffic is better filtered upstream in any case in an API Gateway + WAF.
I have worked with both types of solutions for different use cases (was invited presenter at Azure Serverless Conf[0]), but my take nowadays is that serverless containers are almost always a better approach since it provides much more flexibility.
[0] https://learn.microsoft.com/en-us/shows/azure-serverless-con...
badatnames 3 days ago | parent
At which point we're paying double just to work around cold start latency, which was the original point.
CharlieDigital 3 days ago | parent
So if you're at 50% capacity with lots of idle time, it can scale to 0.
Scale to 0 doesn't mean "cold". One easy way to keep both Cloud Run and Container Apps "warm" but functionally scaled to 0 for costs is to just ping it every few minutes with Cloud Scheduler set up on a cron pointing to a health endpoint.
rahimnathwani 3 days ago | parent
CharlieDigital 3 days ago | parent
This diagram helps visualize: https://www.gstatic.com/bricks/image/5eb3c8e9-6159-4e2f-ba98... (gray bar at the top shows when the instance is started and when it ends; blue bars show actual request, and green bars show the billing)
If there's a 10s gap between requests, you are not billed for the 10s gap, but it is still effectively hot; instance does not stop. Request that comes back in 10s later does not have a startup penalty because the instance is still up.
How do you leverage this to build a high throughput system with no cold starts? Just prime it with a short single request (e.g. `/health`) before instance is stopped.
greatgib 4 days ago | parent
So you might have to wait for 10s or more to have a new lambda instance spawning up and replying to your requests. And you might have to have your function finish in 15 minutes, deals with the strange concurrency and scaling rules lambda is based on.
otterley 4 days ago | parent
Why? What’s the downside? Are you taking the benefits into account in your calculus? This sort of general, input-free recommendation is junior level thinking at best.
> I am fairly confident I could support more capacity with a single t3a.nano instance.
It depends on what resources those connections are using (memory, CPU, I/O, network). What actual work is being done?
hmokiguess 4 days ago | parent
You make it sound like these cases are rare, not sure what kind of work you do but there are markets of all sizes in many different use cases out there.
I feel like what you wanted to say was "I haven't found a need for them" as opposed to "Stay away from it"
Maybe you're trying to say something else we don't know because we don't have your backstory either, did folks at your work tried pushing it for scenarios in which they became a problem? Share that instead as it brings a lot more value to the readers, otherwise it sounds like you are trying to go for a weird flex.
CharlieDigital 4 days ago | parent
The Google paper Towards Modern Development of Cloud Applications[0] does a great job explaining why.
TL;DR the case they make against micro-services architectures (which Lambda encourages):
1. It hurts performance
2. It hurts correctness
3. It is hard to manage
4. It freezes APIs
5. It slows down application development
For even a moderately complex system, spreading logic out over multiple discrete runtimes doesn't make sense; instantly run into each of the 5 points. The only times I've found functions useful is truly single-point behavior where we were running some logic connected to CloudFront on each request for some header parsing.It is certainly possible to write a monolith in Lambda as well, but then that would be bad architecture and a bad fit and I suppose why they are now introducing this new model that is more like GCP Cloud Run or Azure Container Apps.
[0] https://sigops.org/s/conferences/hotos/2023/papers/ghemawat....
bbg2401 4 days ago | parent
You've taken it in a rather odd direction with the request for a framing more palatable to you.
hmokiguess 3 days ago | parent
joshstrange 4 days ago | parent
All that said, there are times I regret my lambda decision and would prefer just a EC2 host even if it cost more. Deployment would be easier/simpler. I've spent considerable time to improve my deploy process and lower the deploy times but it's still ~2-3min from tag -> deployed which I know I could do faster on just a VM. Also everything gets harder in a lambda, packages/binaries, logging, monitoring, etc.
nater5000 4 days ago | parent
>> up to 128 concurrent requests per environment > I am fairly confident I could support more capacity with a single t3a.nano instance.
Don't forget that this is referring to 128 concurrent requests per environment. By default, an AWS account can run up to 1,000 concurrent Lambdas, and that number can be increased with support requests.
Of course, the REAL win is that you only pay for what you use. Your t3a.nano is costing you 24/7, and if you want it to scale on demand, your stack will get very complicated very quickly. Lambdas just scale "for free".
yipinwong 3 days ago | parent
demilicious 3 days ago | parent
yipinwong 3 days ago | parent
> Sometimes things are easily and objectively worse than the alternatives.
That's the most subjective thing one can say.
demilicious 3 days ago | parent
julianwood 3 days ago | parent
jack_sunsetless 4 days ago | parent
CharlieDigital 4 days ago | parent
Edit: even better for .NET and Java as Cloud Run supports startup CPU boost[0] to improve initial cold start JIT performance.
What this looks like deploying a .NET web API to Cloud Run:
# Auth first: gcloud auth configure-docker us-central1-docker.pkg.dev
# Package and push using .NET tools (built in)
dotnet publish --os linux --arch x64 /t:PublishContainer \
-p ContainerRegistry=us-central1-docker.pkg.dev \
-p ContainerRepository=ORG/REG/IMG \
-c Release
# Deploy web API to Cloud Run
gcloud run deploy SVC \
--image=us-central1-docker.pkg.dev/ORG/REG/IMG:latest \
--project=PROJ \
--region=us-central1 \
--cpu-boost \
--max-instances=2 \
--min-instances=0
# Get back a URL to the ingress
I run a bunch of workloads "for free" because most apps are going to fall into the monthly credit pool (180k vCPU seconds; 50h @ 1 vCPU) if it scales to 0.[0] https://cloud.google.com/blog/products/serverless/announcing...
tombert 4 days ago | parent
Not to say it’s “bad”, just interesting how things loop around.
hk1337 4 days ago | parent
joshstrange 4 days ago | parent
It annoys me that when I started with Lambda (2019-ish?) it (at least seemed to) advised against this. I went down the "one function per route/method" path but always disliked it and it added a decent amount of complexity for packaging/deploying. A year or so ago I abandoned that and switched to Fastify (one function instead of 100+) and never looked back. It also makes it easier to test in dev/local and gives me more flexibility to move to a different host in the future.
Weird to see them come around on this but again, what does this give me over what I currently do? It looks like they are just making migrating an existing stack easier (it wasn't that difficult before IMHO).
ryandvm 4 days ago | parent
Just feed it the API docs and loop.
nater5000 4 days ago | parent
Like, most of these services already have proper open-source alternatives you're free to use on your own hardware or even on AWS.
gregfurman 3 days ago | parent
IMO much of the product’s success was derived from the extensive snapshot + behavioural tests they created to validate parity with AWS.
The basic engineering loop was: 1. Write tests against AWS 2. Record all results 3. Run tests from (1) against emulator and diff with results from (2)
Like, theoretically, you could use their preexisting suite of tests to construct a pretty decent emulator, since the engineering + cloud costs of recording behavior has already been frontloaded, and resides within their snapshot files [2].
[1] https://github.com/localstack/localstack
[2] https://github.com/localstack/localstack/tree/main/tests/aws...
TheJCDenton 4 days ago | parent
AWS should have understood by now that Cloudflare workers pricng is so much more legible, it's one of the reason of their success.
nater5000 4 days ago | parent
awithrow 4 days ago | parent
dang 3 days ago | parent
https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor...
nater5000 2 days ago | parent
There's not much to say otherwise. It's a pretty standard release from AWS, so other than just explaining AWS as a whole, I don't have anything to offer in general.
ecshafer 4 days ago | parent
viccis 3 days ago | parent
Stringing together a bunch is an anti-pattern IMO but when it's not being abused, it's wonderful tech.
remify 3 days ago | parent
The frontend is hosted on cloudfront, the backend is a lambda and you basically just pay for the database and certificate.
I don't want to manage a server or even a docker image. I just want my code to exist there so I like the idea
holler 3 days ago | parent
agree, unfortunately in practice it's more common to throw the api behind k8s with containers
happymellon 3 days ago | parent
Something1234 3 days ago | parent
Lord_Zero 3 days ago | parent
jamesfinlayson 3 days ago | parent
I ended up moving a bunch of the logic into an ECS-hosted monolith. Probably cost a bit more (warm-up plugins meant that no customers still cost us money) but it vastly simplified things and made scaling up easier (can't set scaling thresholds with Lambda).
tiew9Vii 3 days ago | parent
I treat Lambda purely as compute and ignore everything else related to "serverless". My Lambda's are monolith webapps using Axum Rust framework. Using cargo lambda I generate a static binary, upload to s3 and point the lambda at it. Sometimes I'll package as a docker image so can run in Lambda or locally by passing a `--aws-lambda` flag.
If serving HTML i'll use Function URLS with IAM auth and put a Cloudflare worker in front acting as the gateway. I also serve the static assets from cloudfront bucket i.e. static.example.com. Advantage is I use Cloudflare free tier so get denial-of-wallet prevention when my free credits run out. Using IAM auth also means the lambda doesn't execute if for what ever reason someone discovers the url and tries to DoS it so only get charged for the requests not run time.
icedchai 3 days ago | parent
remify 3 days ago | parent
Just a lambda, a switch in the handler that calls my routes and that's it. I could make it smarter but I don't really need to
solatic 3 days ago | parent
NodeJS-only feels very pre-AI. Let me tell my agent to write my web service in Rust/C++/C/Go/Zig, and ship a statically-linked single binary that fits within a maximum binary size ceiling. I'd get much better performance, and make much more of the premium CPU/RAM pricing that I'm being asked to pay in exchange for scale-to-zero and fast autoscaling.
The rest is amazing. First-class support as a CloudFront origin. Easy multi-region and gradual deployment. Clearly, finally, a great response to Cloudflare. Just.... so close, and yet, so far. No way am I going back to Node as a web backend for greenfield projects in 2026.
drodgers 3 days ago | parent
Could use optional headers for extra integration points (eg. better per-request resource usage tracking for scaling).
julianwood 3 days ago | parent
solatic 3 days ago | parent
nemothekid 3 days ago | parent
This + Function URL + Cloudfront, and you end up with an API entirely hosted in lambda. I have a backend that does is hosted like this that does pretty complex work (image/video uploads, image conversions, on top of the standard auth, database connections, etc). It even renders a frontend with HTMX/Alpine.
Even with all the bot traffic I receive, at almost 15 million requests per month the cost is under $10/mo (median latency is roughly 90ms). Cold starts are a non-issue with the Rust runtime.
torginus 3 days ago | parent
https://github.com/CodeGenieApp/serverless-express
This wraps Lambda's 'handler' function and allows express to run on top of it, essentially you get a node web server with no persistence between requests which usually isn't a good thing to rely on, but you can also kinda have that with persistent tcp connections.
Of course since this is not real HTTP, things like WebSocket aren't available, but it's good enough to build a CRUD backend or two.
Similar libs exist for other runtimes as well.
Lord_Zero 3 days ago | parent
torginus 3 days ago | parent
But expensive. Stuff like Api Gateway is just absurd (but necessary since you don't want that stuff to reach your lambdas, which are dog slow to handle). Paying per request is like charging for every breath.
Another big advantage (and I guess the reason this exists), is for some reason, AWS lambda is a hostile environment for node, with its ephemeral VMs, performance is quite bad (much worse than expected)
Onavo 3 days ago | parent
mattkenefick 3 days ago | parent
julianwood 3 days ago | parent
deepsun 3 days ago | parent
Both container-way and code-way have the same scalability (code-way is built into a container anyway, just on the cloud). Maybe AWS re-builds the container for security every day?
The page has only a description, no comparisons. The best way to explain a technology is to compare it with something.
happymellon 3 days ago | parent
I agree, lambdas can currently run code, run containers, or fargate for containers.
I guess someone managed to find a usecase that wasn't quite covered.
rbnafo 3 days ago | parent
sciencesama 3 days ago | parent