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
asked 2 months ago96 views
2 Answers
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
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
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
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions