- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
Increase the Lambda timeout. It can be configured up to 15 mins. It looks like yours is set to 5 seconds. It may be it just needs a few more seconds for your code to finishing executing
The Coldstart is also included in the total execution time. It may be because your function warms up the first time and on the 2nd run its already started so runs instantly without a cold start.. I believe you can review the warm up time. May also be worth enabling Lambda Insights for more information
I still recommend increasing time out.
Thanks for your reply! The 5s timeout is totally fine, as the process is usually done in a few hundreds of milliseconds. Even in this case, the time elapsed between start and end of the request is about 600ms and should not have triggered a "timed out" error, which is what I'm worried about here.
Thanks for the insight.
According to the docs, "You are not charged for the time it takes for Lambda to prepare the function but it does add latency to the overall invocation duration." (see https://docs.aws.amazon.com/lambda/latest/operatorguide/execution-environments.html). However, the "billed duration" is at 5s, so it can't be caused by the cold start of the function (and a cold start time of 4s would be extremely surprising for such a small NodeJS function).
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa