Skip to content

[QUERY] Service Bus client - implicit batching #27411

Closed

Description

Library name and version

Azure.Messaging.ServiceBus 7.5.0

Query/Question

Is there an implicit batching mechanism built into Service Bus SDK? What I mean by implicit batching is that I'm calling ServiceBusSender.SendMessageAsync method multiple times in a short interval and they are being somehow batched together before being sent to the Service Bus.

The documentation states that there is a batching mechanism on the server side of the Service Bus. However, I run a set of tests that shows there probably is some kind of batching even when the server-side "batching store access" is disabled on the topic. What's more, I observed that when sending each message from a separate SDK sender instance the batching stopped occurring, which may suggest that the batching is occurring inside the SDK sender (client-side).

The assumption that the batching is happening is based on the observed Incoming Requests metric on the Service Bus side and its comparison to the Incoming Messages metric. When reusing a single SDK sender, the value of the Incoming Requests metric is much lower than the Incoming Messages, but when using different SDK senders for each message, the metric values are equal.

For testing I used a performance benchmark tool created by Microsoft. The exact configuration I used and test results are available in my forked version of this tool (link below), so it can be easily reproduced. To limit the machine's resource utilization, instead of creating an SDK sender for each message I actually used a pool of 1.000 senders created before the test.
https://github.com/starkpl/service-bus-dotnet-messaging-performance/tree/master/ThroughputTest#sdk-senders-pooling-experiment

I would be very grateful for a further explanation of how exactly does implicit batching work in the Service Bus, because it would be very useful when deciding on the topology of topics and for proper usage of the SDK.

Environment

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    ServiceThis issue points to a problem in the service.Service AttentionWorkflow: This issue is responsible by Azure service team.Service Buscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions