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 年前檢視次數 341 次
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!

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南