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
asked 10 months ago487 views
1 Answer
2
Accepted Answer

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
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
profile picture
EXPERT
reviewed 10 months ago
profile pictureAWS
EXPERT
Uri
reviewed 10 months ago
  • 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.

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