Boto SQS 获取大量消息

Boto SQS fetching large numbers of messages

我有一个 python 应用程序,它应该从队列中读取所有消息,然后在将所有消息添加到列表后处理它们。 该过程完成后,它会批量删除消息。

该应用程序完美适用于多达 10 万条消息,但是在对超过 50 万条消息进行负载测试时。

我收到以下错误

botocore.errorfactory.OverLimit: An error occurred (OverLimit) when calling the ReceiveMessage operation: 

Too many messages have been received without being deleted

我明白这是因为我试图获取大量消息而不删除它们,我想知道是否有办法绕过这个。

配额限制在 120K 左右。您可以通过支持请求增加配额。

For most standard queues (depending on queue traffic and message backlog), there can be a maximum of approximately 120,000 inflight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this quota while using short polling, Amazon SQS returns the OverLimit error message. If you use long polling, Amazon SQS returns no error messages. To avoid reaching the quota, you should delete messages from the queue after they're processed. You can also increase the number of queues you use to process your messages. To request a quota increase, submit a support request. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-queues.html