简体   繁体   中英

Slow deleting message from AWS SQS queue

Problem:

I have SQS queue with default settings.

9 consumers pulling messages, with concurrency: 100. As a result, 90% time all work with massage, was spent on removing it from the SQS. There are 2 million messages in queue sometimes.

info - TIME all58189132: 7s 25.336044ms info - TIME delMessage58189132: 7s 3.667635ms

info - TIME all58189132: 7s 25.336044ms info - TIME delMessage90392602: 6s 943.837946ms

info - TIME all90392602: 6s 966.396512ms info - TIME delMessage90392602: 6s 943.837946ms

How can i do it faster?

Basically message-based flow is:

  1. Poll/Listen for the message
  2. Receive message
  3. Do work
  4. Delete message

You have to do all of the above steps. You can not skip any one step. Simply you need to increase the number of consumers.

Note: Increase consumers only when you cannot afford this much execution time. Else, let them take whatever time they are taking.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM