lambda cold start & synchronous execution

0

Hi,

If there is a lambda that is being called frequently enough so that there is always at least one container warm, is there ever a scenario where I could invoke the lambda enough times synchronously, that one (or more) of my invocations could be hit with a warm-up delay while additional containers are spun to handle the load?

Also how many synchronous executions of a lambda will execute on a single container?

For example, if I had a lambda that took 30 seconds to execute and required 256mb – when the first container is created for this lambda to run, how many concurrent threads (each consuming 256mb) would I expect the first container to be able to handle? If I simultaneously call the lambda 100 times, will they all execute on the warm container? Or will more containers be created, and will those subsequent containers cause a warm-up delay in some of the invocations? Alternatively, if I started cold, and then started invoking the lambda consistently every 100ms, will some of these invocations other than the first exhibit a warm-up delay?

AWS
질문됨 6년 전469회 조회
1개 답변
0
수락된 답변

Each lambda execution runs in it's own container. So if you have one warm container and you have a spike in lambda invocations in a short enough time to increase your concurrency you'll get a cold start for the new containers. For example if your concurrency is 1 and have a burst of traffic that raises your concurrency to 10 you'll see 9 cold-starts. This blog is a great resource for understanding how all of this works. I'd also encourage you to look through the lambda best practices as they detail lots of steps that help reduce the cold-start time.

AWS
전문가
Adam_W
답변함 6년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠