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
preguntada hace 2 meses104 visualizaciones
2 Respuestas
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
EXPERTO
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 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
EXPERTO
respondido hace 2 meses
profile picture
EXPERTO
revisado hace 2 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas