← Back to context

Comment by themafia

1 month ago

On AWS if you want raw computational capacity you use Lambda and not EC2. EC2 is for legacy type workloads and doesn't have nearly the same scaling power and speed that Lambda does.

I have several workloads that just invoke Lambda in parallel. Now I effectively have a 1000 core machine and can blast through large workloads without even thinking about it. I have no VM to maintain or OS image to consider or worry about.

Which highlights the other difference that you failed to mention. Hertzner charges a "one time setup" fee to create that VM. That puts a lot of back pressure on infrastructure decisions and removes any scalability you could otherwise enjoy in the cloud.

If you want to just rent a server then Hertzner is great. If you actually want to run "in the cloud" then Hertzner is a non-starter.

Strong disagree here. Lambda is significantly more expensive per vCPU hour and introduces tight restrictions on your workflow and architecture, one of the most significant being maximum runtime duration.

Lambda is a decent choice when you need fast, spiky scaling for a lot simple self-contained tasks. It is a bad choice for heavy tasks like transcoding long videos, training a model, data analysis, and other compute-heavy tasks.

  • > significantly more expensive per vCPU hour

    It's almost exactly the same price as EC2. What you don't get to control is the mix of vCPU and RAM. Lambda ties those two together. For equivalent EC2 instances the cost difference is astronomically small, on the order of pennies per month.

    > like transcoding long videos, [...] data analysis, and other compute-heavy tasks

    If you aren't breaking these up into multiple smaller independent segments then I would suggest that you're doing this wrong in the first place.

    > training a model

    You're going to want more than what a basic EC2 instance affords you in this case. The scaling factors and velocity are far less of a factor.

    • This is a great example of what I meant when I said that a part of the Cloud Tax is it constrains the solution space available to developers. In an era where one can purchase, off-the-shelf, a 256-core machine with terabytes of RAM, developers are still counting megabytes(!) of file sizes due to the constraints of AWS.

      It should be obvious that this is not the best answer for all projects.

    • > If you aren't breaking these up into multiple smaller independent segments then I would suggest that you're doing this wrong in the first place.

      Care to elaborate?

      1 reply →

That's fine, except for all of Lambda's weird limitations: request and response sizes, deployment .zip sizes, max execution time, etc. For anything complicated you'll eventually you run into all this stuff. Plus you'll be locked into AWS.

  • > request and response sizes

    If either of these exceed the limitations of the call, which is 6MB or 256kB depending on call type, then you can just use S3. For large distributed task coordination you're going to be doing this anyways.

    > deployment .zip sizes

    Overlays exist and are powerful.

    > max execution time

    If your workload depends on long uninterrupted runs of time on single CPUs then you have other problems.

    > Plus you'll be locked into AWS.

    In the world of serverless your interface to the endpoints and semantics of Lambda are minimal and easily changed.

    • Of course, we can generally work around all these things. The point is it is annoying to do so. It adds friction and further couples you to a proprietary platform.

      You're better off using ECS / Fargate for application logic.

> [Hetzner] charges a "one time setup" fee to create that VM. That puts a lot of back pressure on infrastructure decisions and removes any scalability you could otherwise enjoy in the cloud.

Hetzner Cloud, then! In the US, $0.53/hr / $333.59/mo for 48 vCPU/192GB RAM/960GB NVMe. Includes 8 TB/mo traffic, when 8 TB egress would cost $720 on EC2; more traffic is $1.20/TB when the first tier of AWS egress is $90/TB. No setup fee. Not that it's EC2 but there's clearly flexibility there.

More generally, if you want AWS, you want AWS; if you want servers you have options.

Very few providers charge setup, some will provision a server within a 90s of an api call.