Live data from Hacker News

AWS Lambda pricing now per ms

aws.amazon.com

241–250 of 291 posts

Re: AWS Lambda pricing now per ms

#241
post #6

Necessary change. Now writing stuff in fast languages suddenly matter in cost, changing the landscape of when these solutions might become viable for a chase.

thats ok they will slow down some random dependency to compensate for their loss

We are drowning in so much cynicism these days. Can't we just accept that some things are actually good news?

Re: AWS Lambda pricing now per ms

#242

Oh, that absolutely changes the price calculation for Lambda. Historically the 100ms minimum billing interval made Lambda significantly more expensive than EC2 for large numbers of work loads.

My needs were different and the EC2 vs Lambda different was state vs stateless.

This won’t save me a ton of money; but at least I won’t have to guess on if bumping up to the next CPU+MEM tier will get me from 101ms to 99ms

Re: AWS Lambda pricing now per ms

#244

Earlier quoted context omitted.

And it costs even more if you need that Lambda function to have access to the internet. A possibly useful comparison: A Raspberry Pi 3 (~6.5 watts) costs $6.83 per year to run full-time (at 12 cents per kWh). You get a full computer with much more I/O. However, there are a lot of other factors to consider: - Initial cost of the hardware - Time and energy spent maintaining/configuring the device - Physical maintenance…

A RPi 3 has an upfront cost of over 10 dollars. With lambda you can start with pennies.

And write in any language, and have no OS/patches/updates/hardware to look after, have built in logging, a complex but robust authentication system, etc etc.

Re: AWS Lambda pricing now per ms

#245

Earlier quoted context omitted.

> No to be clear I'm saying you are comparing things that are way more different than our friends at Cloudflare would like you to think. Care to expand on that? What exactly do you mean by "things are way more different"?

This is pretty standard AWS marketing spiel. They make vague assertions of "ah but you're not considering the big picture...." with no details

If you want to compare two things that are different in a ton of ways, don't be mad when someone points it out.

Re: AWS Lambda pricing now per ms

#246

Does Lambda still lag from awake?

There are warm and cold runs. If it’s really important you can pre-heat by calling the lambda every so often. It would be nice if they had some option for this.

There's Provisioned Concurrency for Lambda which keeps an amount of Lambdas warm at a price, so you don't have to keep pinging your function yourself to pre-heat.

Re: AWS Lambda pricing now per ms

#247

Earlier quoted context omitted.

My lambdas run for 15 minutes. I feel that they're still a great choice :)

Huh... that's the limit of lambda functions, are you doing some sort of work in 15 minute chunks?

Instead of processing 10 messages off of SQS per lambda we process 10, then start polling for more using the same lambda, and don't stop until the lambda is just about to die.

Re: AWS Lambda pricing now per ms

#248
post #234

Earlier quoted context omitted.

> In the real world you don't import 5 seconds worth of dependencies into a lamdba Laughs in data science . > a 5 second boot time for a longer-lived service is acceptable. Not every application can tolerate the occasional 5-second-long request. Just because Python can cold boot "hello world" 3 seconds faster than Go doesn't mean that's going to hold in the real world.

You're mixing arguments here. It's not the occasional 5-second long request, it's "the app doesn't start serving requests for 5 seconds". Using data science tooling in a lambda seems iffy, especially ones that are not production ready. And good luck getting such libraries in go. Python cold booting an interpreter 3 seconds faster than Go is a big deal, especially if your target execution time is <50ms and you've got…

> You're mixing arguments here. It's not the occasional 5-second long request, it's "the app doesn't start serving requests for 5 seconds".

Lambdas cold-start during requests. So the unlucky request that triggers a cold start eats that cold start.

> Using data science tooling in a lambda seems iffy, especially ones that are not production ready.

Nonsense, there are a lot of lambdas that just load, transform, and shovel data between services using pandas or whathaveyou. Anyway, don't get hung up on data science; it was just an example, but there are packages across the ecosystem that behave poorly at startup (usually it's not any individual package taking 1-2s but rather a whole bunch of them scattered across your dependency tree that take 100+ms).

> And good luck getting such libraries in go.

Go doesn't have all of the specialty libraries that Python has, but it has enough for the use case I described above.

> Python cold booting an interpreter 3 seconds faster than Go is a big deal, especially if your target execution time is According to https://mikhail.io/serverless/coldstarts/aws/languages/, Go takes ~450ms on average to cold start which is still up a bit from Python's ~250ms. To your point, if you're just slinging boto calls (and a lot of lambdas do just this!) and you care a lot about latency, then Python is the right tool for the job.

> not being silly and importing ridiculously heavy dependencies into a lambda for no reason other than to make a strange point about Python being unsuitable for something nobody should be doing.

Not every lambda is just slinging API requests--some of them actually have to do things with data. Maybe someone is transforming a bit of audio as part of a pipeline or doing some analysis on a CSV or something else. Latency probably matters to them, but they still have to import things to get their work done. And according to https://mikhail.io/serverless/coldstarts/aws/#does-package-s... (at least for JavaScript) just 35mb of dependencies (which will buy you half of a numpy iirc) causes cold start performance to go from ~250ms to 4000ms.

My rule of thumb (based on some profiling) is that for every 30mb of Python dependency, the equivalent Go binary grows by 1mb, moreover, it all gets loaded at once (as opposed to resolving each unique import to a location on disk, then parsing, compiling, and finally loading it). Lastly, Go programs are more likely to be "lazy"--that is, they only run the things they need in the main() part of the program whereas Python packages are much more likely to do file or network I/O to initialize clients that may or may not be used by the program.

Re: AWS Lambda pricing now per ms

#249

Does Lambda still lag from awake?

There are warm and cold runs. If it’s really important you can pre-heat by calling the lambda every so often. It would be nice if they had some option for this.

I suppose I can ping it upon page visit (for web apps). That never occurred to me until now.

Re: AWS Lambda pricing now per ms

#250

Earlier quoted context omitted.

It's not necessarily the same in outcome. Undercutting competitors can be a temporary thing. As soon as the competitors are eliminated you jack the prices up. Doing it to be nice to customers can potentially last even after competitors go belly up. Then again, Google's motto used to be "do no evil" (basically be nice to customers). That obviously went the way of the dodo bird.

>>As soon as the competitors are eliminated you jack the prices up And then you provide a competitor or startup another opportunity.

Eventually. But Amazon has the headspace to drop prices for as long as they need to kill the new competition. Only someone like Google or MS will be able to keep up as long as they can automate a lot and use money from ads or software licenses to prop up their cloud business.
Post reply on HN