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
질문됨 일 년 전527회 조회
1개 답변
2
수락된 답변

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
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
profile picture
전문가
검토됨 일 년 전
profile pictureAWS
전문가
Uri
검토됨 일 년 전
  • 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.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠