简体   繁体   English

Azure Service Bus速度

[英]Azure Service Bus speed

When I try sending 1000 simple messages to my Azure Service Bus queue from a simple console application (not in debug mode), it takes 90 seconds with http mode. 当我尝试从一个简单的控制台应用程序(不是在调试模式)向我的Azure Service Bus队列发送1000条简单消息时,使用http模式需要90秒。

With standard nettcp mode it takes 70 seconds. 使用标准的nettcp模式需要70秒。

Is the speed everyone else gets also? 其他人的速度也是吗? I expected it to go faster, but maybe this is correct? 我预计它会更快,但也许这是正确的?

Are you doing all of this in the same thread? 你是在同一个线程中做所有这些吗? Try using multiple Threads/Tasks do submit the messages in parallel. 尝试使用多个线程/任务确实并行提交消息。 Also, if you want a higher throughput you can try making some changes to your app.config: 此外,如果您想要更高的吞吐量,可以尝试对app.config进行一些更改:

  <system.net>
    <settings>
      <servicePointManager expect100Continue="false" useNagleAlgorithm="false"/>
    </settings>
    <connectionManagement>
      <add address = "*" maxconnection = "48" />
    </connectionManagement>
  </system.net>

Finally, try executing the console app from within a Windows Azure VM (preferably the same datacenter). 最后,尝试从Windows Azure VM(最好是同一数据中心)内执行控制台应用程序。 This will rule out any influence of your WAN connection. 这将排除WAN连接的任何影响。

Also look at leveraging the batch sending methods. 另请参阅利用批量发送方法。 The Azure SDK has a method on the Service Bus Client Queue that allows you to send a batch of messages at one time. Azure SDK在Service Bus Client Queue上有一个方法,允许您一次发送一批消息。 It reduces total network overhead at the expense of larger calls. 它以较大的呼叫为代价减少了总网络开销。 You can tune the batch size to be a maximum that works for you, and queue messages until you fill up a batch or a certain timeout is reached. 您可以将批处理大小调整为适合您的最大值,并将消息排队,直到您填满批处理或达到某个超时。 This allows you to batch but still be responsive in a reasonable time. 这允许您批量但仍然在合理的时间内响应。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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