Too many messages in flight

0

Hi,

I have an SQS-consumer (https://github.com/bbc/sqs-consumer) running on an EC2 machine (t2.medium). There is only one instance of this process running at the time. However, when I open my SQS dashboard I see more than 30 messages in flight. It's a FIFO queue, with deduplication based on MessageGroupId. I'm not using any batching the library offers, just simple consumer one message at a time as the library tutorial shows. What am I missing here?

The reason for concern is that I'm getting A LOT of timeout errors when processing messages (I'm using Puppeteer to open websites and check for links on them) - and I'm trying to narrow down the cause for this - and overloading the t2 machine network bandwidth might be one of them (I think).

asked a year ago341 views
1 Answer
0
Accepted Answer

It's possible that the sqs-consumer is not deleting messages from the queue immediately after they are processed. This could be causing the messages to remain "in flight" for longer than necessary and causing the number of messages in flight to accumulate over time. Are you deleting messages after processing?

profile pictureAWS
Niko
answered a year ago
  • thank you for pointing me in the right direction, in fact due to some other errors I wasn't doing a Promise.resolve for my message handler (which is required by sqs-consumer library to delete the message).

  • Glad you found the root cause!

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.

Guidelines for Answering Questions