Azure MQ Service Bus Throughput

I know this is a new addition to SS so I hope there is some room for improvement. I created a simple Service that publishes 10,000 messages and a 32 thread (tested with 8 and 16) reader for that message. The app is hosted on Azure in the same data center where the service bus is located and the throughput is maybe 100 per minute on the reader. I’ve tested service bus with the client setting prefetch and maxconcurrent and it should be able to scale to 10k per minute. Can you allow for additional options in the creation of the ServiceBusMqServer specifically on prefetch and maxconcurrent?

I also can’t seem to find a way to DisablePublishingResponses?

Any help or guidance on increasing the throughput?

Do you publish messages in one thread? If publisher is only one maybe the bottleneck is located on publisher side and it cannot put amount needed for the readers and they are waiting for messages in queue? Can you share the code you’ve used for testing performance?

It’s possible to add settings for options PrefetchCount and MaxConcurrentCalls but need to check them first that change of their values will not break message handling in ServiceStack services. I’m looking into it.

I did a parallel for and pumped 10k messages into a queue. That was about a minute. The read took I don’t know how long 100 messages per minute takes. I didn’t want the publisher to wait for a return so the bottleneck was the reader. I’ll post the code in a bit but it was just a for loop pushing a simple message.

I really wanted to test one way publish to send notifications for events which is why I wanted to disable the response (didn’t see the option) and why I was testing the throughput by publishing a user ID and message and having another process send it.

Here is the publish:

 var range = Enumerable.Range(1, 10000);
        Parallel.For(0, range.Last(),
              index => {
                  this.PublishMessage<QueueMessage>(new QueueMessage() { Id = index+20000, BodyHtml = "test" });
              })

Here is the receiver:

public void Post(QueueMessage m)
    {
        
        return;
    }

The queue filled up quickly, it took hours for it to empty.

Thanks, I’ll try to reproduce and find why it gets messages so slowly.

By the way DisablePublishingResponses was added in this commit which is available from v1.0.45 on MyGet

Thanks . The register handler I had 32 threads but all that does is call the receiver posted above.

Also not sure if you read this but it has some nice performance tips