batch window lower than 20s but lambda function is called in 20s interval

0

In lambda manual, there is:

If you're using a batch window and your SQS queue contains very low traffic, Lambda might wait for up to 20 seconds before invoking your function. This is true even if you set a batch window lower than 20 seconds.

What is the cause behind this? I asked chatGPT and Bard, but neither of them could give me a solid answer.

  • How is your visibility timeout configured?

  • It's 30 seconds by default

質問済み 3ヶ月前154ビュー
1回答
0
承認された回答

I think I get the root cause. Lambda is using long polling to get messages from SQS. it will wait for the message for up to 20 seconds. So even if there is no message during that time and a shorter batch window like 2 seconds has been set, the function will be invoked after 20 seconds with an empty message.

I will vote myself :-)

回答済み 3ヶ月前

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

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

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

関連するコンテンツ