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
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
エキスパート
回答済み 1年前
profile picture
エキスパート
レビュー済み 1年前
profile picture
エキスパート
レビュー済み 1年前
profile pictureAWS
エキスパート
Uri
レビュー済み 1年前
  • 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.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ