Live data from Hacker News

AWS Lambda pricing now per ms

aws.amazon.com

41–50 of 291 posts

Re: AWS Lambda pricing now per ms

#41

I am curious to see if this will mean a shift to more efficient languages (Go or Rust) for Lambda services, as usually people default to JS

JS is a great choice for Lambda thanks to great cold performance. I’m seeing runtimes in the 40ms to 100ms range.

Most of the time in Lambda is usually spent waiting for IO, which is slow in any language. If you’re using Lambda for heavy computation, that’s not a great choice.

Re: AWS Lambda pricing now per ms

#42
post #36

I am curious to see if this will mean a shift to more efficient languages (Go or Rust) for Lambda services, as usually people default to JS

On the one hand I read that JS Lambdas were often already under 100ms (30-50ms) On the other hand I heard legends about under 10ms Rust Lambdas.

That's the point- billed per ms, a Lambda that executes in 5ms is 10x cheaper than one that takes 50ms. Billed per 100ms interval, the total cost of the two is the same.

Re: AWS Lambda pricing now per ms

#44
post #33

Earlier quoted context omitted.

If a process takes that long, lambda would be a poor architectural choice.

Not necessarily. For low frequency workloads with reasonably long step times, Lambda can still make sense. (E.g. When videos appear in this S3 bucket, process them.) You might only drop videos in once a week, but when you do you want to run some code against them. There are plenty of distributed workflow reasons to run long running Lambdas infrequently rather than spinning up and down an EC2 instance.

Right but the first thought I had was, couldn’t you fan out and run a lambda for each frame or a group of related frames? (E.g. Batch HLS processing would be really easy!) If so, you’re back to short lambdas again. It’s really the sweet spot for using Lambda after all: lots of big jobs can be broken down into lots of little jobs, etc.

Re: AWS Lambda pricing now per ms

#45
post #20

Earlier quoted context omitted.

It's still measured by wall clock time - not CPU time. I'd love to see them bill for actual CPU time.

I'd bet a significant portion of their margins come from this, given Lambda's focus on I/O-bound workloads.

If the profits exist there, then others might eventually find it advantageous to have this metric in the future.

Maybe even accounting for strong and weak nuclear forces (not sarcasm...we are engineering at the quantum level now, soon it will be apart of a business metric. Instead of 'equipment' being servers, it might be the domain-space-time used).

Re: AWS Lambda pricing now per ms

#46
post #17

Earlier quoted context omitted.

If it takes 60 seconds, that's 600 steps. 601 steps isn't that much of a saving. It matters close to 0.

If a process takes that long, lambda would be a poor architectural choice.

I used an extreme to show the point. At 800 ms the savings are also less than closer to 0.

Re: AWS Lambda pricing now per ms

#47
post #33

Earlier quoted context omitted.

If a process takes that long, lambda would be a poor architectural choice.

Not necessarily. For low frequency workloads with reasonably long step times, Lambda can still make sense. (E.g. When videos appear in this S3 bucket, process them.) You might only drop videos in once a week, but when you do you want to run some code against them. There are plenty of distributed workflow reasons to run long running Lambdas infrequently rather than spinning up and down an EC2 instance.

Lambdas are underpowered and often poor choices for compute-heavy workloads. Unless there's an urgency to processing infrequent videos, it might make more sense to backlog messages to the queue and use spot instances for draining the queue and processing videos, especially from a cost perspective. Though I acknowledge that this is a more complex setup.

Re: AWS Lambda pricing now per ms

#48

I am curious to see if this will mean a shift to more efficient languages (Go or Rust) for Lambda services, as usually people default to JS

From the research I did, here's how languages stack up in Lambda runtime (lowest first):

1. Python & JS 2. Go 3. C# & Java

I couldn't find any data on Rust.

The understanding at the time was that Python & JS runtimes are built-in, so the interpreter is "already running" Go is the fastest of compiled languages, but just can't beat the built-in runtimes. C# and Java were poorest as they're spinning up a larger runtime that's more optimized for long-running throughput.

https://docs.aws.amazon.com/lambda/latest/dg/best-practices....

https://medium.com/the-theam-journey/benchmarking-aws-lambda...

https://epsagon.com/development/aws-lambda-programming-langu...

https://read.acloud.guru/comparing-aws-lambda-performance-of...

Of course, benchmarks like this only go so far. Use as a starting point for your own evaluation; not as an end-all-be-all.

Post reply on HN