Martin
Martin

Reputation: 1536

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.

With standard nettcp mode it takes 70 seconds.

Is the speed everyone else gets also? I expected it to go faster, but maybe this is correct?

Upvotes: 6

Views: 1244

Answers (2)

jojackso
jojackso

Reputation: 106

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. 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.

Upvotes: 1

Sandrino Di Mattia
Sandrino Di Mattia

Reputation: 24895

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:

  <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). This will rule out any influence of your WAN connection.

Upvotes: 6

Related Questions