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 réponse
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
répondu il y a un an

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions