6

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?

Martin
  • 1,521
  • 3
  • 18
  • 35

2 Answers2

6

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.

Sandrino Di Mattia
  • 24,739
  • 2
  • 60
  • 65
1

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.

jojackso
  • 96
  • 3