0

Hi guys I would like to take out a doubt. The solution to this question is a little bit controversial. AWS Solution Architect Associate Exam question

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
    Because 2x300 < 1000. See "What is the throughput quota for an Amazon SQS FIFO queue?" at the [SQS FAQ](https://aws.amazon.com/sqs/faqs). – jarmod Feb 06 '23 at 16:52
  • Yes, you are right. But you are considering 2 SQS without batching, with batching of 10 messages each SQS can reach 3000 msg/sec. So following this line, with batching of 2 messages 600 msg/sec, 2 SQS then 1200 msg/sec what would satisfy the requirement. – Lucas Vital Feb 06 '23 at 17:17
  • When you say "2 SQS then 1200 msg/sec" you seem to be suggesting 2 SQS queues. That isn't compatible with the requirement to process messages in order. – jarmod Feb 06 '23 at 17:29
  • An actual AWS exam would never expect you to remember a value such as the maximum throughput of an Amazon SQS FIFO queue. Questions are focussed more on solutions than esoteric numbers to remember. – John Rotenstein Feb 06 '23 at 20:40

1 Answers1

3

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.

luk2302
  • 55,258
  • 23
  • 97
  • 137
  • Yep! 300 msg/sec with no batching, but what about considering the batch? The documentation said: "Each partition supports up to 3,000 messages per second with batching, or up to 300 messages per second for send, receive, and delete operations. ... To optimize partition utilization for the DeleteMessageBatch and ChangeMessageVisibilityBatch APIs, AWS recommends using ReceiveMessage requests with the MaxNumberOfMessages parameter set to 10, and batching the receipt-handles returned by a single ReceiveMessage request." – Lucas Vital Feb 06 '23 at 17:22
  • Proportionally using the MaxNumberOfMessages parameter to 2, then each SQS is able to receive until 600 msg/sec, 2 SQS/msg would satisfy the requirements of the question. – Lucas Vital Feb 06 '23 at 17:24
  • 1
    @LucasVital "Each SQS" is not a term that exists. *The* one queue only supports 300 operations per second. And it does not matter how many consumers you have. The queue only supports 300 operations and therefore using no batches it would support at max 300 messages per second, if you set the max number to 2 the queue will support you receiving 600 messages. You cannot just arbitrarily multiply that number by 2 again, other than by doubling the batch size. – luk2302 Feb 06 '23 at 21:28
  • Perfect, that was exactly the point I wasn't understanding. Now I got it, Thank you for the clarification! – Lucas Vital Feb 07 '23 at 12:10