Why AWS Lambda function with Pytorch takes additional 10 seconds than sam local invoke

0

Hello, I am new to AWS Lambda, I created a Pytorch Lambda function using SAM with architecture x86_64. When invoking the same function with SAM local invoke, the total billable seconds is around 7 seconds, but after "sam deploy --guided" I invoked lambda function + API gateway using Python request module with the exact same setting as sam local invoke (Memory = 3 GB). Then the total billable seconds is around 17 seconds. I just did not understand why there is 10 seconds increase in time.

1回答
1

Lambda cold start have to allocate a work environment (frirecracker virtual environment) to download your code, setup the local runtime and run your code. It may take few seconds in the first invocation but for other invocations this is not required.

Please take a look on this following blog: https://aws.amazon.com/pt/blogs/compute/operating-lambda-performance-optimization-part-1/ https://aws.amazon.com/pt/blogs/compute/operating-lambda-performance-optimization-part-2/

profile pictureAWS
回答済み 1年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン