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
gefragt vor 2 Monaten102 Aufrufe
2 Antworten
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
EXPERTE
beantwortet vor 2 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten
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
EXPERTE
beantwortet vor 2 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen