Re:Ask HN: Are you using AWS Lambda in production?
by catchmeifyoucan on Sunday October 14, 2018 @09:59PM
(#18216896)
I don't think it's too bad, about ~1s for a cold start. But let's say you serve your login page with Lambda, every request thereafter could be much faster because your function is no longer cold. 1 slow request, but chances are your user is making more than one, or usually it's a fire and forget like a form submission.
https://hackernoon.com/im-afraid-you-re-thinking-about-aws-l...
'Cold starts' is a complicated topic. AWS will keep your Lambda 'hot' for ~5 minutes since the last invocation - you are not paying for the 5 minutes, but it still sits in their RAM waiting for requests. This means that any request within 5 minutes of the last request does not pay the cold-start price. So I used Pingdom to monitor/ping the endpoint every 5 minutes, thus keeping one instance of the function perpetually 'hot'. Note that this hack will not work if you need high concurrency: you can only keep 1 instance alive. In practice, it's enough for us as one instance can serve most of the traffic in our case.