如何提高amazon sqs排队速度?
How to increase amazon sqs queuing speed?
我正在尝试将数千条消息排队到 sqs。我正在循环基于计数的 for 循环并将消息发送到队列。下面是我的循环的样子
$sqsClient = AWS::createClient('sqs');
for($i=0; $i<=$count;$i++){
$sqsClient->sendMessage(array(
'QueueUrl' => 'https://sqs.us-west-2.amazonaws.com/xyz123/QueueName',
'MessageBody' => 'Hello World',
));
}
这样它每秒只排队 10 条消息。我怎样才能增加它以每秒排队 1000 条消息。
请帮助,提前致谢。
根据 "Amazon SQS Product Details" 页面(参见 https://aws.amazon.com/sqs/details/),您似乎固定为每批 10 个请求的限制(参见 "Functionality" 部分):
Messages can be sent, received or deleted in batches of up to 10
messages or 256KB. Batches cost the same amount as single messages,
meaning SQS can be even more cost effective for customers that use
batching.
我还在常见问题解答中注意到,根据您的级别,您每月只能收到固定数量的消息(请参阅此处的 "Billing" 部分:https://aws.amazon.com/sqs/faqs/):
The Amazon SQS free tier provides 1 million requests per month at no
charge. Many small scale applications may be able to operate entirely
within this free tier limit. Data transfer charges may still apply
(see Pricing). The free tier is a monthly offer. Free usage does not
accumulate across months.
如果您使用他们的免费套餐并打算每秒发送数千条消息,我怀疑您会很快达到 100 万个请求。
希望这些信息对您有所帮助!
SQS 是一个分布式系统。从多个 threads/processes/machines 并行发送消息以提高吞吐量。
要将消息传递增加到 1000 messages/second,您将必须对 AWS SQS 使用水平扩展。这是在 AWS SQS 中实现横向扩展的开发人员指南。
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/throughput.html
如果您只是使用普通队列而不缩放 10 messages/sec 是您唯一可以实现的。
我正在尝试将数千条消息排队到 sqs。我正在循环基于计数的 for 循环并将消息发送到队列。下面是我的循环的样子
$sqsClient = AWS::createClient('sqs');
for($i=0; $i<=$count;$i++){
$sqsClient->sendMessage(array(
'QueueUrl' => 'https://sqs.us-west-2.amazonaws.com/xyz123/QueueName',
'MessageBody' => 'Hello World',
));
}
这样它每秒只排队 10 条消息。我怎样才能增加它以每秒排队 1000 条消息。
请帮助,提前致谢。
根据 "Amazon SQS Product Details" 页面(参见 https://aws.amazon.com/sqs/details/),您似乎固定为每批 10 个请求的限制(参见 "Functionality" 部分):
Messages can be sent, received or deleted in batches of up to 10 messages or 256KB. Batches cost the same amount as single messages, meaning SQS can be even more cost effective for customers that use batching.
我还在常见问题解答中注意到,根据您的级别,您每月只能收到固定数量的消息(请参阅此处的 "Billing" 部分:https://aws.amazon.com/sqs/faqs/):
The Amazon SQS free tier provides 1 million requests per month at no charge. Many small scale applications may be able to operate entirely within this free tier limit. Data transfer charges may still apply (see Pricing). The free tier is a monthly offer. Free usage does not accumulate across months.
如果您使用他们的免费套餐并打算每秒发送数千条消息,我怀疑您会很快达到 100 万个请求。
希望这些信息对您有所帮助!
SQS 是一个分布式系统。从多个 threads/processes/machines 并行发送消息以提高吞吐量。
要将消息传递增加到 1000 messages/second,您将必须对 AWS SQS 使用水平扩展。这是在 AWS SQS 中实现横向扩展的开发人员指南。
http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/throughput.html
如果您只是使用普通队列而不缩放 10 messages/sec 是您唯一可以实现的。