考虑使用 Azure 服务总线来替换一些不可靠的 RabbitMQ 服务器,但定价方面不清楚的一件事是,出于计费目的,它们到底算作“代理连接”吗?/p>
我们有大约十几台机器正在处理超过 1,000 个队列的消息(以及一台机器填充队列),因此在一台机器上运行的 1 个应用程序是否算作一个代理连接(无论它正在监听多少个队列)?或者每台机器是否算作 1,000 多个代理连接(这可能会非常快速增加)?
假设我做了这样的事情:
var queues = queueNames.Select(q =>
{
if (!manager.QueueExists(q))
{
manager.CreateQueue(q);
}
return new QueueClient(ServiceBusConnectionString, q);
}).ToArray();
Add queueNames
是一个由 10 个字符串组成的数组。那是 10 个代理连接吗? 1 ?还是别的什么?
最佳答案
当您保持队列连接打开并等待消息时(例如,如果您保持队列打开等待消息 30 秒),队列的轮询会遇到代理连接的成本。如果您使用默认的零超时(当没有消息可接收时仅返回 null),则它不会被视为代理连接。非零超时的一个示例是使用类似 Receive(TimeSpan)
的内容。您等待指定超时的位置。
您可以使用OnMessageAsync
监听消息而不是轮询,这看起来不像代理连接。
至于其计算方式,看起来这是该月每小时平均的并发连接数。定价指南中有一些很好的计算示例。
A brokered connection is defined as one of the following:
An AMQP connection from a client to a Service Bus queue or topic/subscription.
An HTTP call to receive a message from a Service Bus topic or queue that has a receive timeout value greater than zero.
Service Bus charges for the peak number of concurrent brokered connections that exceed the included quantity (1,000 in the Standard tier). Peaks are measured on an hourly basis, prorated by dividing by 744 hours in a month, and added up over the monthly billing period. The included quantity (1,000 brokered connections per month) is applied at the end of the billing period against the sum of the prorated hourly peaks.
您可能应该通过计费门户中的支持与 Azure 团队确认这一点,他们通常对此类请求非常满意。
关于azure - 代理连接是如何计算的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49982864/