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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则