Lambda behavior

0

Recently, at my workplace, I've been working extensively with Go-based Lambdas. In the most recent case, I made some changes that I tested locally and then in a QA environment. The Lambda always had a 100% success rate in doing what it was supposed to do. However, when the team that needs to use the Lambda passed it almost 400 files simultaneously, the success rate dropped to only 50%. (The Lambda triggers when a certain file is uploaded to an S3 path.) I don't understand why. When the Lambda is called "slowly," it can do its job well, but when "too many" files arrive all at once, something goes wrong. Does anyone have any insight into this behavior?

andre
已提問 2 個月前檢視次數 102 次
2 個答案
1

Hello.

It is difficult to make an accurate judgment without checking the Lambda log for errors, but for example, it is possible that Lambda is timing out because there are too many files to process, or that the number of Lambda executions is too large and the concurrency limit is being reached.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html

profile picture
專家
已回答 2 個月前
profile picture
專家
已審閱 2 個月前
0

One thing to check here is that when there are frequent events, you'll often find that the SQS event notification to the Lambda function contains multiple entries. To put it another way: The event notification contains an array ("list" in Python terms) of files that were uploaded.

In your code: Make sure you are processing all of the events that are delivered, not just the first one. Because if the Lambda function returns successfully then the Lambda service will mark all of the events passed in via SQS as completed even if the code has only processed the first one.

profile pictureAWS
專家
已回答 2 個月前
profile picture
專家
已審閱 2 個月前

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

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

回答問題指南