Live data from Hacker News

Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

aws.amazon.com

1–10 of 140 posts

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#3
Listen folks - it's still a fantasy. Latency is still 5s on many requests = no deal.

This has been going on for years.

Would someone form AMZ please stand up?

I suggest that the latency is 5s for the 'first call', then, subsequent calls are fast - and if you don't use your lambda for a minute or so, it goes back to having latency.

I suggest maybe this has something to do with loading it into memory when it's used?

There must be a way to keep the lambdas 'hot' or else it will never really get used for anything but background tasks.

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#4
post #2

Can you achieve competitive latency for web pages using API Gateway and Lambda?

I think acloud.guru is served through lambda. I think if you go the single page app route with S3 + cloudfront CDN + API gateway + lambda (so many words/things) you can deliver a really high quality product. You can also cache responses out via elasticache. It's not perfect but the development velocity and potential is really exciting.

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#5
post #3

Listen folks - it's still a fantasy. Latency is still 5s on many requests = no deal. This has been going on for years. Would someone form AMZ please stand up? I suggest that the latency is 5s for the 'first call', then, subsequent calls are fast - and if you don't use your lambda for a minute or so, it goes back to having latency. I suggest maybe this has something to do with loading it into memory when it's used? Th…

You break the entire model of an oversubscribed multi-tenant container system if you want every lambda hot all the time.

If that's what you need...you need a server.

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#6
post #3

Listen folks - it's still a fantasy. Latency is still 5s on many requests = no deal. This has been going on for years. Would someone form AMZ please stand up? I suggest that the latency is 5s for the 'first call', then, subsequent calls are fast - and if you don't use your lambda for a minute or so, it goes back to having latency. I suggest maybe this has something to do with loading it into memory when it's used? Th…

stands up https://www.youtube.com/watch?v=eJO5HU_7_1w

You're describing container re-use which is documented in the page here: http://docs.aws.amazon.com/lambda/latest/dg/lambda-introduct...

You could have cloud watch run the function every minute? Again, that won't guarantee that your function will be "hot". But it's a quick hack to potentially reduce the frequency of your slow initial start.

That said customer feedback is super helpful in making great services so I'll get this feedback to the lambda team (or they may see it here).

If you ever need any help my email is in my profile and I'm happy to work with you.

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#9
I have just recently got through a migration from express to a lambda based stack. In the end, performance is pretty good (once the lambdas are warm), but there were a few tricky parts, but nothing impossible.

Serving backend requests is easy with Lambda, but the code for managing the backend can get quite large, quickly. If you are loading up data and it's going to take more than 5 minutes to perform a task, you need to build a queueing system from AWS primitives.

Re: Going Serverless: Migrating an Express App to AWS API Gateway and AWS Lambda

#10
If anyone's interested in doing the math about the costs involved, I have two quick notes: first, the API Gateway, at $3.50 per million requests, is typically more expensive than the Lambda functions themselves (and comes with no permanent free tier, unlike Lambda); second, the 128MB minimum memory for a Lambda function can be on the tight side for an Express app, so you might want to base your calculations on more memory.
Post reply on HN