Lambda cold start possible solution?

前端 未结 6 1911
青春惊慌失措
青春惊慌失措 2021-01-03 23:42

Is scheduling a lambda function to get called every 20 mins with CloudWatch the best way to get rid of lambda cold start times? (not completely get rid of)...

Will

6条回答
  •  粉色の甜心
    2021-01-04 00:21

    You can improve the cold start time by allocating more memory to your Lambda function. With the default 512MB, I am seeing cold start times of 8-10 seconds for functions written in Java. This improves to 2-3 seconds with 1536MB of memory.

    Amazon says that it is the CPU allocation that really matters, but there is no way to directly change it. CPU allocation increases proportionately to memory.

    And if you want close to zero cold start times, keeping the function warm is the way to go, as described rsp suggested.

提交回复
热议问题