SQS triggered lambda function not creating more than 1 instance.

0

I have created a SQS FIFO queue and added a lambda function as a trigger. The problem I am running into is that whenever i put in messages (tested it with 60 messages) in the queue only 1 lambda instance is created. Even though there are 50 more messages (Batch size is 10) still in the queue.

I have waited for about 10 minutes the time it takes to process all the messages in the queue still only 1 instance is doing the job for that whole duration and any other instance is not getting created. I can tell because I can only see 10 messages in flight for the whole duration.

Details about the lambda function and SQS:

  • Lambda timeout: 15 minutes
  • Lambda memory: 2048mb
  • Batch size: 10
  • Maximum concurrency: 200
  • Default visibility timeout: 15 Minutes
  • Delivery delay: 0 Seconds
  • Receive message wait time: 20 Seconds
demandé il y a un an527 vues
1 réponse
2
Réponse acceptée

Hi

Does your messages in the queue have different message group ID? Since it'c a FIFO queue messages with the same ID will be processed in order, as per documentation: Amazon SQS ensures that messages in the same group are delivered to Lambda in order. Lambda sorts the messages into groups and sends only one batch at a time for a group https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-scaling

profile picture
EXPERT
répondu il y a un an
profile picture
EXPERT
vérifié il y a un an
profile picture
EXPERT
vérifié il y a un an
profile pictureAWS
EXPERT
Uri
vérifié il y a un an
  • No, they have the same group ID.

    Thank you! I changed the code to send the messages in different group ids and it fixed the issue, now the lambda function is scaling as expected.

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions