Hacker News new | ask | show | jobs
by posabsolute 3853 days ago
It's funny we tested lambda + Amazon gateway api this week at work.

It's awesome!.. Until you have to deal with the cold start issue. Our first call takes about 1.5 seconds; and then all other calls take about 50-80ms.

Your container stays in cache about 5-10 minutes unless it is called back, there are no guarantees.

This micro service is not called often and for us 1.5 seconds is never acceptable.

3 comments

Our issue was price. Boss did the math for our use case, around a million hits/sec 24/7, and it worked out to billions of dollars. We're building a solution (on aws) for a little less than that.
It's good the boss can do that sort of math. That's why you need him and why he is called the boss.
Why do I have a feeling that you are the "boss" in this picture? :)
You could use a scheduled cron task in Lambda to make requests to keep your API hot.
Yeah we thought about that, but is it reliable? We were really not sure we could always get rid of the cold start issue.
AWS Lambda function schedules are driven off the same fault-tolerant, highly available service that powers SWF. (So...yes, they're reliable :)
Is keeping it hot with a cron job reliable though?
Give SNS/SQS a look for polling solutions for API Gateway. We got around it by having a health check call in our set up.
You could potentially use that task as an availability test too.
There's the performance issue on startup, then there's the cost issue with the typical case. With the "round up to the nearest 100ms" pricing, your example ends up overpaying 20-50% for the _typical_ case. If you have any serious use of your app, you are better off with DIY on EC2 or using Heroku.