[英]Multiple Lambda functions are being triggered for single batch size
I have added a trigger to Lambda to Pool for messages from SQS (Standard) with batch size of 10000 and batch window of 10 seconds.我已将触发器添加到 Lambda 到池中,以获取来自 SQS(标准)的消息,批处理大小为 10000,批处理 window 为 10 秒。 For testing, I added 3 messages to my SQS so ideally there should be one lambda function to process all 3 messages but this is not the case, it's triggering 3 lambda functions each for one message.为了测试,我向我的 SQS 添加了 3 条消息,因此理想情况下应该有一个 lambda function 来处理所有 3 条消息,但事实并非如此,它为一条消息触发了 3 个 lambda 函数。 Can anyone help me is there something which I'm missing here?任何人都可以帮助我这里有什么我想念的吗?
Can anyone help me is there something which I'm missing here?任何人都可以帮助我这里有什么我想念的吗?
Yes.是的。 Because there are always at least five pooling threads for each lambda function. Each pooler will invoke a function. So its possibile that your 3 messages were pooled by three different poolers, which then invoked your function 3 times (each time with one message).因为每个 lambda function 总是至少有五个池线程。每个 pooler 将调用一个 function。因此您的 3 条消息可能由三个不同的 pooler 池化,然后调用您的 function 3 次(每次一条消息)。 From docs :来自文档:
the Lambda service will begin polling the SQS queue using five parallel long-polling connections . Lambda 服务将开始使用五个并行长轮询连接轮询 SQS 队列。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.