Live data from Hacker News

AWS Lambda as a back end for a single-page app

lg.io

31–40 of 77 posts

Re: AWS Lambda as a back end for a single-page app

#31

How does the pricing compare with say X amount of tasks that run for 1 second each compared to what you could expect from 1 hour on a medium ec2 instance? EDIT: I see it offers "The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month. " What is a GB-second ;)

Re: pricing -- good question I'm going going to test that.

Re: gigabyte seconds: It's how much memory (RAM) you're using:

128mb RAM (lowest possible value) for 10s == 1 GB/s

1gb RAM for 1s == 1 GB/s

I think it's a pretty clever way to (somewhat) directly correlate compute cost with power (energy). If you remember what John McCarthy said when he imagined that computing would be a public utility one day (http://www.technologyreview.com/news/425623/the-cloud-impera...) I think this is about as close to that as we're going to get for a little while.

Re: AWS Lambda as a back end for a single-page app

#32
post #31

How does the pricing compare with say X amount of tasks that run for 1 second each compared to what you could expect from 1 hour on a medium ec2 instance? EDIT: I see it offers "The Lambda free tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month. " What is a GB-second ;)

Re: pricing -- good question I'm going going to test that. Re: gigabyte seconds: It's how much memory (RAM) you're using: 128mb RAM (lowest possible value) for 10s == 1 GB/s 1gb RAM for 1s == 1 GB/s I think it's a pretty clever way to (somewhat) directly correlate compute cost with power (energy). If you remember what John McCarthy said when he imagined that computing would be a public utility one day ( http://www.te…

Thanks I get it now, nice reference :)

Re: AWS Lambda as a back end for a single-page app

#33
post #19

Earlier quoted context omitted.

You should be able to do that as described here : https://aws.amazon.com/blogs/compute/running-executables-in-... Note that there are some limits regarding the size of the zip you upload [1]. 1: http://docs.aws.amazon.com/lambda/latest/dg/limits.html

Thanks for the links! If my executable relies on .so files in a lib directory, is it possible to set env variables to point to a local path?

Why would you need to do that? Just set DT_RUNPATH when you link the binary and use the $ORIGIN variable to set a relative path.

Re: AWS Lambda as a back end for a single-page app

#34
post #3

Earlier quoted context omitted.

he mentions in the article he created that account specifically to only have the ability to call that one lambda function - which I didnt realize you could restrict to that level.

I like this one better because it demos using google auth to get temporary aws credentials: https://github.com/cloudnative/lambda-chat

Last message is "Peter Sankauskas Hello". I tried to send some message, and it's saying "Message sent to SNS successfully". But these message never show up in the page.

Re: AWS Lambda as a back end for a single-page app

#35
Naive question: how does his example differ from a server responding to HTTP requests, that would take a JSON event as an argument and return a json version of:

    "the value was: "+ event['key1']
I suppose the AWS wins in term of set up and easiness of deployment. Anything else?

Re: AWS Lambda as a back end for a single-page app

#38
post #35

Naive question: how does his example differ from a server responding to HTTP requests, that would take a JSON event as an argument and return a json version of: "the value was: "+ event['key1'] I suppose the AWS wins in term of set up and easiness of deployment. Anything else?

It differs in that you don't have to worry about scaling up that HTTP server, or pay for the machine hosting that HTTP server. With Lambda, you only pay per requests, current rate is $0.20 per 1 million requests.

Re: AWS Lambda as a back end for a single-page app

#39
"the future is now, and it's down because somebody used the secret key to drain the poster's bank account"

To be sure, the author specifies that the IAM role being exposed here is only allowed to invoke the function. That's great for the security of the other resources on the account, but still allows a reasonably determined attacker to run up a Bill of Unusual Size quite rapidly.

For instance, the rate limiter currently kicks in at 1000TPS. Assuming the smallest memory size (128MB) and requests <100ms, that's a worst-case spend of roughly $18/day per Lambda function. Not the wallet-melting consequences of, say, accidentally posting AWS root credentials but not great either. Multiply that by the number of endpoints you'd likely want in a single-page app, and it gets expensive.

Re: AWS Lambda as a back end for a single-page app

#40
post #39

"the future is now, and it's down because somebody used the secret key to drain the poster's bank account" To be sure, the author specifies that the IAM role being exposed here is only allowed to invoke the function. That's great for the security of the other resources on the account, but still allows a reasonably determined attacker to run up a Bill of Unusual Size quite rapidly. For instance, the rate limiter curre…

But the same is true of any backend. Once you know the endpoint being used by the frontend, you can blast the backend with requests and one of two things will happen:

* You will take down the site (a DoS attack). * Or the victim has auto-scaling and you rack up their AWS charges.

This is hardly a unique problem to Lambda.

Post reply on HN