6 ms·
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 abou
by posabsolute 11y 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.
- toomuchtodo 11y agoYou could use a scheduled cron task in Lambda to make requests to keep your API hot.
- posabsolute 11y agoYeah we thought about that, but is it reliable? We were really not sure we could always get rid of the cold start issue.
- twagner 11y agoAWS Lambda function schedules are driven off the same fault-tolerant, highly available service that powers SWF. (So...yes, they're reliable :)
- anonymoushn 11y agoIs keeping it hot with a cron job reliable though?
- beefsack 11y agoYou could potentially use that task as an availability test too.
- toadkicker 11y agoGive SNS/SQS a look for polling solutions for API Gateway. We got around it by having a health check call in our set up.
- imglorp 11y agoOur 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.
- CodeWriter23 11y agoThere'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.