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

Load balance mode #62

Closed
wants to merge 7 commits into from

Conversation

linglingye001
Copy link
Contributor

No description provided.

}
}

// If we found the last successful client,we'll rotate the list so that the next client is at the beginning

Choose a reason for hiding this comment

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

Suggested change
// If we found the last successful client,we'll rotate the list so that the next client is at the beginning
// If we found the last successful client, we'll rotate the list so that the next client is at the beginning

@linglingye001 linglingye001 force-pushed the user/linglingye/loadbalance branch from 1a38b87 to 3f10c09 Compare July 29, 2024 09:05
@linglingye001 linglingye001 marked this pull request as ready for review July 29, 2024 09:07

// If we found the last successful client,we'll rotate the list so that the next client is at the beginning
if nextClientIndex < len(clients) {
clients = append(clients[nextClientIndex:], clients[:nextClientIndex]...)
Copy link
Contributor

@RichardChen820 RichardChen820 Aug 1, 2024

Choose a reason for hiding this comment

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

I have concern about this, this would be executed in super high frequency, almost every time of executing the ExecuteFailoverPolicy() right? It would create new array every time, have to allocate a new memory space to accommodate the new array.

Copy link
Contributor

@RichardChen820 RichardChen820 Aug 1, 2024

Choose a reason for hiding this comment

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

We can think of a more effective way to do the array rotation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Array rotation is executed every time when ExecuteFailoverPolicy called, I don't think the frequency will be super high. It depends on the refresh interval the customer set and if load balance mode enabled. Besides, the number of replicas usually will not reach hundreds, O(n) time complexity is acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

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

But it may have many AzureAppConfigurationProvider yaml resources in one cluster to reconcile, and the improvement would be super easy to implement, so I think it's worth making a change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants