简体   繁体   English

多个 Lambda 函数被触发用于单个批量大小

[英]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?任何人都可以帮助我这里有什么我想念的吗?

Lambda SQS 触发器

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.

相关问题 在 Lambda 中使用多个函数 - Use multiple functions in Lambda Terraform 处理多个 lambda 函数 - Terraform handle multiple lambda functions 如果 AWS Lambda function 在指定时间段(假设 2 小时)内未运行(或未被触发),是否可以发送警报? - Is there a way to send an alert if an AWS Lambda function is not running(or not being triggered) for a specified period of time (let's say 2 hours)? 如何在 Lambda 处理程序中处理多个异步函数? - How to handle multiple async functions in a Lambda handler? 从一个 SQS 触发器触发多个 lambda 函数 - Triggering multiple lambda functions from one SQS trigger 如何在 CDK 中对多个 AWS Lambda 函数进行单元测试? - How to unit test multiple AWS Lambda functions in CDK? 一个项目中的多个 Spring Cloud Functions 部署在 AWS Lambda - Multiple Spring Cloud Functions in one project for deployment on AWS Lambda AWS Lambda function 从 SQS 队列读取时不考虑批量大小 1 - AWS Lambda function not respecting batch size 1 when reading from SQS Queue 改变 aws lambda 运动的消费者批量大小是否会导致数据丢失或重复 - Does changing aws lambda consumer batch size of kinesis cause data loss or duplication 部署为 Docker 图像时如何运行多个 lambda 函数? - How to run multiple lambda functions when deploying as a Docker image?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM