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 Risposta
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
con risposta un anno fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande