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

질문됨 일 년 전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
답변함 일 년 전
  • 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!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠