英文:
Why 4 SQS FIFO with not batch to reach 1000 msg/sec during a peak demmand and not 2 SQS FIFO each with a btach of 2 msgs?
问题
Hi guys,我想澄清一个疑问。这个问题的解决方案有点具有争议性。
Ok,你可以在批处理模式下使用4个SQS FIFO,达到每秒1200条消息的速率。
但是我可以使用2个SQS FIFO,每个批处理中有2条消息,也可以达到相同的每秒1200条消息的速率。我只是按照解决方案的理由来做,如果每个批次中有10条消息,那么每秒可以处理3000条消息,那么有2条消息的批次就是每秒600条消息。为什么不呢?
难道我漏掉了什么吗?
英文:
Hi guys I would like to take out a doubt. The solution to this question is a little bit controversial.
Ok, You can use 4 SQS FIFO in batch mode and reach the rate of 1200 msg/sec.
But I could use 2 SQS FIFO in batch mode each with a batch of 2 messages reaching the same 1200 msg/sec. I just follow the solution reason, If each with a batch of 10 has a batch of 3000 msg/sec, then with a batch of 2 messages then 600msg/sec.
Why not?
Did not I get something?
答案1
得分: 3
根据Amazon Simple Queue Service中的高吞吐量队列和与消息相关的配额,FIFO队列的限制是每秒300个(ReceiveMessage
)操作。
如果您有1000条消息/秒:
- 1000 / 300 = 3.33,四舍五入 => 需要每批处理4条消息,以处理1000条消息/秒。
- 您的每批2条消息将仅导致读取600条消息/秒。
这些限制是每个队列的,不是每个队列的消费者的,也不是所有队列的总和。
英文:
According to High throughput for FIFO queues - Amazon Simple Queue Service and Quotas related to messages
the limit of FIFO is 300 (ReceiveMessage
) operations / second.
If you have 1000 messages / s:
- 1000 / 300 = 3.33, round it up => 4 messages per batch required to process 1000 messages / s.
- Your 2 messages per batch would only result in 600 messages / s being read.
These limits are per queue, not per consumer of a queue and not across all queues.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论