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).

1回答
0
承認された回答

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
回答済み 1年前
  • 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!

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン