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
feita há 2 meses104 visualizações
2 Respostas
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
ESPECIALISTA
respondido há 2 meses
profile picture
ESPECIALISTA
avaliado há 2 meses
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
ESPECIALISTA
respondido há 2 meses
profile picture
ESPECIALISTA
avaliado há 2 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas