Skip to content

SQS with a high volume of traffic, What is the starting time for calculating the visibility timeout?

0

Our team has a SQS with a high volume of traffic (about 1200+ message/min peak), but we mush restrict our sqs consuming speed to avoid make callees throttle. Yesterday, our SQS was stuck, and we see that lots of messages entered DLQ without exception and we can see the message was resolved 3 times successfully(Maximum receives = 3 in our DLQ setting), we guess that is because the stuck cause the processing time is out of visibility timeout. That made our stuck more seriously because we need to resolve most of messages with extra 2 times. After we set the visibility timeout from 2 min to 30 min the consuming speed accelerated.

Question1: What is the starting time for calculating the visibility timeout? Question2: I want to know if there is any risk for set a long visibility timeout. Will this cause messages with exceptions to take a long time (if Maximum receives = 3 then 20 minutes) to enter the DLQ?

And our queue is a standard queue. This is our sqs consumer setting at 08/26

We have 3 host(not 4) , and maximumPoolSize was 1, sleepTimeBetweenPollsMillis = 1000ms, queueCapacity by default = 100, So only 300 msgs can be in the queue, what will happen If the msg number more than queueCapacity?

1 Answer
1

Hi,

I would strongly suggest you to read in details this series of 3 blog posts about SQS best practices: https://aws.amazon.com/blogs/compute/implementing-aws-well-architected-best-practices-for-amazon-sqs-part-3/ (part3 has links to other 2)

It will help you implement an SQS architecture that matches the best practices of AWS Well-Architected.

On your question re. visibility timeout computation: it is defined at https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html

When a consumer receives a message from an Amazon SQS queue, the message 
remains in the queue but becomes temporarily invisible to other consumers. This 
temporary invisibility is controlled by the visibility timeout, a mechanism that 
prevents other consumers from processing the same message while it is being 
worked on. Amazon SQS does not automatically delete the message; instead, the 
consumer must explicitly delete the message using the DeleteMessage action after it has been successfully processed.

Enter image description here

Best,

Didier

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.