Limit on number of threads in lambda

0

Hi, Lambda documentation specified that there is a limit of 1024 on the execution processes/threads for a lambda function. Just wanted to know one thing that, If a function is invoked multiple times and same execution environment is used, then will it be 1024 for each invocation or all invocations will share that 1024? Example - 2 invocations (not concurrent) will have limit of 1024 or 2048?

Raguram
已提問 1 年前檢視次數 2389 次
1 個回答
0

Hi,

at any time the lambda function is executing you have a limit of 1024 running threads/processes.

Any threads/processes that have not exited when the lambda execution is suspended at the end of an invocation will be resumed at the next invocation. They will therefore count against the limit.

Cheers,

Massimiliano

AWS
專家
已回答 1 年前
  • Thanks for the response Massimiliano. So the limit of 1024 is per instance and not per invocation right? If the same instance is used for 2 invocations, the limit of 1024 will be applicable instead of 2048. Please let me know if i am missing anything.

  • This is correct. Each instance has the 1024 limit. If you create a thread each invocation and you do not kill it, after ~1024 invocations in the same instance, you will fail to create the new thread.

  • Thanks Uri for clarification

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南