65 pointsby HatchedLake7214 hours ago12 comments
  • bob10293 hours ago
    I strongly recommend never using functions as a service unless you genuinely have some client edge compute requirement that absolutely cannot be solved via some other means.

    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.

    • joshstrangean hour ago
      I agree and disagree with this. I run multiple software platforms that are incredibly bursty, to the level of "no traffic for 10 months out of the year, small traffic of 1-1.5 months, medium for <1 week, and high for 1-2 days" (event-based, like a physical in-person event, not events in the software sense). While I agree lambdas are fiddly and I have some reasons to move off them, they also are kind of perfect for my use case from a billing perspective. Even a t3a.nano would have cost more and not scaled quite as easily as I needed.

      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.

    • badatnames2 hours ago
      These one-sided arguments come up every time there's a Lambda thread. They're useful and easily cheaper almost anywhere you have sparse compute or RAM requirements, even for heavyweight tasks like transcoding. A t3.nano meanwhile can simultaneously be overpriced ($3.50 for an idle task) and a bottleneck (30Mbit/s sustained network) in just as many places as a Lambda could be applied incorrectly.
      • ryandvman hour ago
        They're also good for extremely bursty loads. I use Lambdas extensively for a radar imagery API that delivers the images for an Android live wallpaper that shows weather radar.

        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....

        • CharlieDigital25 minutes ago
          There's nothing particularly special about Lambda's scaling. You can do the same with GCP Cloud Run[0] or Azure Container Apps[1]

          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...

          • badatnames19 minutes ago
            So long as you don't count >2 orders of magnitude difference in scaleup time as particularly special..
            • CharlieDigital14 minutes ago
              That's not how it works since each instance can handle multiple requests (up to 1000 per instance). So you may set this to scale at say 75% load level.

              Indeed if you configured each instance as a single threaded handler, you will not have fun.

    • vermilingua2 hours ago
      I seem to have had the opposite experience. Using Lambda (I can't speak for many of the other FaaS platforms) is so straightforward to me that there need to be some strong arguments for hosting code/containers in my projects.

      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.

      • CharlieDigital31 minutes ago
        If you haven't tried Azure Container Apps or GCP Cloud Run, I would strongly recommend trying them at least once deploying any standard web API app in your language of choice, just for your edification.

        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.

    • nater500033 minutes ago
      This is like the Normal Distribution meme: naively, using Lambdas for these services seems like an obvious choice. Once you start getting into the weeds of it, though, you start to realize that there are real trade-offs which make Lambda not as obvious a choice as they appear at first glance. But once you've worked through those pains and complexity, you end up realizing that there's no free lunch and Lambda is actually a great service for these tasks, all things considered.

      >> 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".

    • otterley2 hours ago
      > I strongly recommend never using functions as a service unless you genuinely have some client edge compute requirement that absolutely cannot be solved via some other means.

      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?

    • hmokiguessan hour ago
      > unless you genuinely have some client edge compute requirement that absolutely cannot be solved via some other means

      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.

      • CharlieDigital36 minutes ago
        I would agree with OP with "stay away".

        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....

      • bbg240121 minutes ago
        They said what they wanted to say, and it was quite clear. The person who commented suggests we don't use client-edge compute unless we have a specific need for it, i.e., don't treat it as a default due to its apparent simplicity up front.

        You've taken it in a rather odd direction with the request for a framing more palatable to you.

  • TheJCDenton38 minutes ago
    Yay ! Active CPU billing mean the same thing as Cloudflare ! But you still pay memory for as long as the function is up. Data transfer is not included, you have to take that into account. There is also the number of requests...

    AWS should have understood by now that Cloudflare workers pricng is so much more legible, it's one of the reason of their success.

  • ryandvman hour ago
    I feel like we're in an age where a very small team of devs armed with enterprise LLM subscriptions could absolutely build and maintain an open source, reverse engineered, self-hosted implementation of all of Amazon's most high profile AWS offerings (S3, SQS, Lambdas, IAM, EC2, DynamoDB, etc.). All as a single, cohesive open source project.

    Just feed it the API docs and loop.

    • nater500029 minutes ago
      Sure... but the point with using AWS is that I don't have to self-host these services lol

      Like, most of these services already have proper open-source alternatives you're free to use on your own hardware or even on AWS.

    • ActionHankan hour ago
      > feel like we're in an age where a very small team of devs armed with enterprise LLM subscriptions

      Ok, but who is paying them?

      • gman209342 minutes ago
        AWS also tends to have hardware that is available for you to use.
  • nater500028 minutes ago
    Jeeze, there's a lot of comments in this thread written by people who have no clue how any of this works lol
  • joshstrangean hour ago
    I guess the event translation step is not needed but I don't see what this gives you over what many of us do today: shove Hono/Express/Fastify into a lambda with some shim/adapter.

    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).

  • HatchedLake7214 hours ago
    looks like an answer to Cloudflare Workers
    • ZiiS4 hours ago
      Isn't this a move in the other direction. Workers and traditional Lambda need to you write short lived event handlers; this is about running a standard server.
    • mikeocool2 hours ago
      The real advantage of cloudflare workers is you don’t pay for the processing time while you’re waiting for upstream network responses.

      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.

      • syrusakbaryan hour ago
        > I believe Cloudflare is the only FaaS that offers that

        Wasmer also offers the same (charging only for active CPU usage), with the advantage that you can run full Node.js and Python workloads :)

      • jasonjmcgheean hour ago
        And there are even hibernateable websockets too - only paying for when data is actually transferring.

        And the maximum worker time is based on processing time, not wall time.

    • CharlieDigital2 hours ago
      Google Cloud Run and Azure Container Apps feels like the closest analogues.

      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.

    • paduc2 hours ago
      Absolutely, and the offer is better in terms of DX (no need for an adapter) and it’s not limited to 128MB of memory.

      Exciting times, I can’t wait for Cloudflares response.

    • dzongaan hour ago
      but this is built on firecracker vm. while Cloudflare workers are built on v8 isolates. at the moment Cloudflare workers have no equivalent. Deno was the only one trying to do the same.

      what will be interesting to see is startup times.

      • AznHisokaan hour ago
        Why doesnt Amazon or any hyperscale replicate Workers? After all they all have the scale of infrastructure
        • felixgalloan hour ago
          Probably because their solution is technically superior from a safety perspective?
    • Imustaskforhelp4 hours ago
      Also vercel, railway, render etc

      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

    • beastman823 hours ago
      And appengine
      • cowsandmilk3 hours ago
        A response to App Engine 18 years after its release?
        • beastman823 hours ago
          It's the same idea however you characterize it.
  • tombert2 hours ago
    This sort of just feels like those “free PHP hosting” sites you would see in ~2004 now.

    Not to say it’s “bad”, just interesting how things loop around.

    • hk1337an hour ago
      Feels like they’re placating to those that keep bundling their entire application, php or node, into a single lambda.
  • cowlevel3 hours ago
    How is this different from a container?
    • kichik3 hours ago
      The scaling part. You don't need to do anything. It just runs as many instances of the Lambda as needed for you.
      • cowlevel3 hours ago
        Does Elastic Container Service not do that?
        • kichik3 hours ago
          No, not really. You can attach auto scaling to it. But it doesn't scale as fast. And it's not very straightforward to scale to zero. And you have to maintain all of it yourself.
          • oblio2 hours ago
            Fargate does, though. And it's been doing it for at least 5 years, if not more.
            • kichik2 hours ago
              Fargate, just like ECS, doesn't natively scale to zero. You can set the minimum number of instances to zero for both, but there is no native mechanism to scale it back to one when traffic arrives. And especially not one that would hold the connection until the container is ready. Not saying it's impossible... Just not native. And it would require extra resources. So the price won't scale to zero without something like Lambda in front of it.
    • Callumk773 hours ago
      Skip the docker part I guess? More approachable for new vibe-orientated developers
      • 3 hours ago
        undefined
    • paduc2 hours ago
      It’s one isolated process per request.

      In a container the memory/cpu is shared for all incoming requests.

      • ZiiS2 hours ago
        It supports 128 simultaneous requests web function; and many more if they are serial. It also supports multiple processes per function.
    • vends3 hours ago
      [flagged]
  • chaz63 hours ago
    Being able to handle concurrent requests with one worker is nice. I hope this becomes available for Python too.
  • jack_sunsetless3 hours ago
    Finally Lambda without the adapter layer.. Now please add .NET and Java with those concurrent requests
    • CharlieDigital2 hours ago
      Cloud Run says "Hi"

      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...

  • ztywtoan hour ago
    [flagged]
  • quietFalcon4 hours ago
    [dead]