Codementor Events

How to solve cold start in AWS Lambda function

Published May 04, 2019Last updated May 06, 2019

People alway rave about how good serverless is but avoid a key problem which is the cold start.

Cold Start occurs when aws lambda function has not been invoked for about 10 minutes. As a result, it needs a few hundred milliseconds to come online.

This can really affect performance.

To resolve this there are 2 solutions:

  1. Have a cloudwatch rule that hits your lambda every 10 minutes.
    This way it will be active no matter what. This can incur some cost.

  2. Have all your api run through your lambda(something like graphql) so your lambda is always warm.

If you want to talk more about this, you can book a time with me at http://manaknightdigital.com/codementor.html

Discover and read more posts from Ryan Wong
get started