question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUERY] Azure.Messaging.ServiceBus Processing speed of messages question

See original GitHub issue

Query/Question How can we help?

I have been testing using Azure.Messaging.ServiceBus recently and have noticed slow processing speeds when using session message processor or any of the Session Receiver ReceiveMessagesAsync overloads and just looping through all my messages. So far in my testing I have only been able to make a single receiver process between 5 and 8 messages a second when receiving 5000 messages that are 100 byte per message. When running a lot of session receivers concurrently processing different messages session with a small number of messages the performance is pretty good but a single receiver with a lot of messages doesn’t seem great. I’ve also played around with the prefetch option and maybe saw a message or two a second improvement. I’ve tried prefetch values of 100 and 500.

Is this excepted or am I doing something wrong here?

Here is a sample of my code to receive just as a basic example. This uses the IAsyncEnumerable implmentation but I get similar speeds when using the other overload of ReceiveMessagesAsync and when using the session processor itself.

var receiver = await _serviceBusClient.CreateSessionReceiverAsync(<topicName>,
	<subscriptionName>, new ServiceBusSessionReceiverOptions
	{
		SessionId = "1",
	}, token);

var messageCount = _consoleOptions.NumberOfMessagesPerSession;

await foreach (var message in receiver.ReceiveMessagesAsync(token))
{
	messageCount--;
	await receiver.CompleteMessageAsync(message, token);

	if (messageCount == 0)
	{
		break;
	}
}

Environment:

  • Azure.Messaging.ServiceBus-preview 4
  • .net core 3.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JoshLove-msftcommented, Sep 16, 2020

I think this might be a difference in the behavior when using sessions: https://docs.microsoft.com/en-us/azure/service-bus-messaging/message-sessions#impact-of-delivery-count

The delivery count is apparently only incremented if the session lock is lost.

1reaction
chris-skuvaultcommented, Sep 1, 2020

@JoshLove-msft Think i’m good for now. Thanks for all your assistance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check how long message stay in Service Bus
In our project we are using azure service bus and azure functions. We are faced performance issues. So we want to check how...
Read more >
Processing Service Bus Queue Messages One-By-One
The call/result conversation will only take a few seconds per message so the lock timeout should never be a problem. If I'm using...
Read more >
Azure Service Bus and its Complete Overview
Azure Service Bus is a messaging service on cloud used to connect any applications, ... processing power, as they pull messages at their...
Read more >
Azure Functions: Choosing between queues and event hubs
Messages 1–9 process in a few milliseconds, but message 10 is taking a few minutes to process. What happens to events 11–50? They...
Read more >
Microsoft Azure Service Bus operation
The Microsoft Azure Service Bus operation defines how to process messages from a queue, topic, and subscription.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found