Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Hubs Client] Load Balancer Options #13047

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

jsquire
Copy link
Member

@jsquire jsquire commented Jun 26, 2020

Summary

The focus of these changes is to allow for additional options to control load balancing within the event processor types set the stage for implementing
different strategies for load balancing. Also included are surfacing options within the consumer client to allow tuning the prefetch count and batch size, to allow performance tuning.

Note: The associated API changes were reviewed and approved by the architecture board. Tags have been curated to reflect that.

Last Upstream Rebase

Friday, June 26, 1:22pm (EDT)

References and Related Issues

@jsquire jsquire added Event Hubs Client This issue points to a problem in the data-plane of the library. APIChange labels Jun 26, 2020
@jsquire jsquire added this to the [2020] July milestone Jun 26, 2020
@jsquire jsquire self-assigned this Jun 26, 2020
@jsquire jsquire force-pushed the eventhubs/load-balancer-options branch from ca48901 to c223fea Compare June 26, 2020 17:40
@@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External", "External", "{797FF941-76FD-45FD-AC17-A73DFE2BA621}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Messaging.EventHubs", "..\Azure.Messaging.EventHubs\src\Azure.Messaging.EventHubs.csproj", "{65ECFE8C-4D8C-454B-AC63-4559FBE5AF7A}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is temporary until the Event Hubs core package is shipped and we can return to a package dependency.

@jsquire jsquire force-pushed the eventhubs/load-balancer-options branch from c223fea to c36446c Compare June 26, 2020 19:03
Copy link
Member

@christothes christothes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I just added some minor questions and suggestions.

The focus of these changes is to allow for additional options to control
load balancing within the event processor types set the stage for implementing
different strategies for load balancing.  Also included are surfacing options within
the consumer client to allow tuning the prefetch count and batch size, to allow
performance tuning.
@jsquire jsquire force-pushed the eventhubs/load-balancer-options branch from c36446c to 4a462e5 Compare June 26, 2020 19:58
@@ -538,15 +537,17 @@ await foreach (var partitionEvent in eventChannel.Reader.EnumerateChannel(option
// Determine the partitions for the Event Hub and create the shared channel.

var partitions = await GetPartitionIdsAsync(cancellationToken).ConfigureAwait(false);
eventChannel = CreateEventChannel((BackgroundPublishReceiveBatchSize * partitions.Length * 2));

var channelSize = options.CacheEventCount * partitions.Length * 2L;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is not performance-critical and we advise not calling it for production scenarios. The potential for having a smaller channel size than is ideal for very large values is not a concern.

@@ -391,8 +388,10 @@ public virtual async Task<string[]> GetPartitionIdsAsync(CancellationToken cance

try
{
eventChannel = CreateEventChannel((BackgroundPublishReceiveBatchSize * 4));
cancelPublishingAsync = await PublishPartitionEventsToChannelAsync(partitionId, startingPosition, options.TrackLastEnqueuedEventProperties, options.OwnerLevel, eventChannel, cancellationSource).ConfigureAwait(false);
var channelSize = options.CacheEventCount * 4L;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is due to be restructured to not make use of the background publishing channel before release; the overflow protection here is temporary.

@jsquire jsquire merged commit c26a810 into Azure:master Jun 27, 2020
@jsquire jsquire deleted the eventhubs/load-balancer-options branch June 27, 2020 13:30
prmathur-microsoft pushed a commit that referenced this pull request Jul 8, 2020
The focus of these changes is to allow for additional options to control
load balancing within the event processor types set the stage for implementing
different strategies for load balancing.  Also included are surfacing options within
the consumer client to allow tuning the prefetch count and batch size, to allow
performance tuning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Event Hubs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants