简体   繁体   English

当AWS说lambda有1000个并发执行限制时,这是什么意思?

[英]What does it mean when AWS says lambda has limit for 1000 concurrent execution?

I am trying to understand the limits of AWS lambda mentioned on the AWS Lambda Limits documentation page. 我试图了解AWS Lambda限制文档页面上提到的AWS Lambda的限制

It says that Lambda has a limit of 1000 concurrent executions . 它说Lambda最多可以有1000个并发执行

Let's say we have a Lambda FunctionX , It takes a folderName from an S3 bucket and processes each item in that folder. 假设我们有一个Lambda FunctionX ,它从S3存储桶中获取一个folderName并处理该文件夹中的每个项目。

Now, I know that Lambda serves each request independently. 现在,我知道Lambda会独立处理每个请求。 So if 1000 users try to Invoke FunctionX , with different folder names, FunctionX will serve each request independently and process each folder. 因此,如果有1000个用户尝试使用不同的文件夹名称调用FunctionX ,则FunctionX将独立处理每个请求并处理每个文件夹。

Does this mean if 1001 requests are made then the Lambda FunctionX will not process the additional 1 request? 这是否意味着如果发出1001个请求,则Lambda FunctionX将不会处理其他1个请求?

OR, 要么,

By concurrency, does AWS mean, when FunctionX is executing for user1 , it can process 1000 items in that folder concurrently. 通过并发,AWS是否意味着当FunctionXuser1执行时,它可以同时处理该文件夹中的1000个项目。 (Can create 1000 threads to process the items in the folder?) (可以创建1000个线程来处理文件夹中的项目吗?)

OR, 要么,

I can have N different lambda functions, (F1, F2...., F1000, F1001, FN), handling different functionality. 我可以使用N个不同的Lambda函数(F1,F2 ....,F1000,F1001,FN)来处理不同的功能。 And at a time any 1000 unique Lambda functions can execute concurrently? 一次可以同时执行1000个唯一的Lambda函数吗?

That AWS Limits documentation page links to Managing Concurrency - AWS Lambda , which says: 该AWS Limits文档页面链接到管理并发-AWS Lambda ,其中说:

Account Level Concurrent Execution Limit 帐户级别并发执行限制

By default, AWS Lambda limits the total concurrent executions across all functions within a given region to 1000. 默认情况下,AWS Lambda将给定区域内所有功能的并发执行总数限制为1000。

So, the answer to your question is that a maximum of 1000 Lambda functions can be executing at any one time in that account . 因此,您的问题的答案是, 该帐户中一次最多可以执行1000个Lambda函数。

Further down, it says: 再往下走,它说:

Throttling Behavior 节流行为

On reaching the concurrency limit associated with a function, any further invocation requests to that function are throttled, ie the invocation doesn't execute your function. 在达到与某个函数关联的并发限制时,对该函数的任何进一步的调用请求都会受到限制,即,该调用不会执行您的函数。

What happens to your extra execution depends on how it was triggered. 您额外执行的结果取决于触发方式。 In some cases, it is rejected. 在某些情况下,它会被拒绝。 In other cases, it is queued. 在其他情况下,它排队。

For example, if the function is executed synchronously via the Invoke command, it will fail. 例如,如果通过Invoke命令同步执行该功能,它将失败。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM