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

Enhancement Proposal: Consistent Hash with Bounded Loads Sharding Algorithm Implementation #16570

Open
akram opened this issue Dec 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@akram
Copy link
Contributor

akram commented Dec 7, 2023

Summary

This enhancement proposal suggests the implementation of a new sharding algorithm, specifically the "Consistent Hash with Bounded Loads" algorithm, in the Argo CD system. The Consistent Hash with Bounded Loads algorithm aims to address challenges related to cluster-to-shard assignments and load uniformity during dynamic changes to the Argo CD environment.

Motivation

The motivation behind this proposal is to improve the efficiency and effectiveness of sharding within Argo CD, particularly when making changes to the number of shards, clusters, or applications. The existing sharding algorithms, including the legacy method and the round-robin algorithm, have shown limitations in maintaining optimal load distribution and minimizing unnecessary cluster-to-shard assignment changes.

By implementing the Consistent Hash with Bounded Loads algorithm, we aim to achieve the following benefits:

  1. Reduced Cluster-to-Shard Assignment Changes: Minimize the redistribution of cluster-to-shard assignments, especially when altering the number of shards, resulting in more stable and efficient operation.

  2. Dynamic Load Balancing: The algorithm should dynamically adjust weights based on the load, ensuring that the shard with the least number of applications receives a higher weight during shard assignment, leading to improved load balancing.

  3. Optimized Resource Utilization: The algorithm should contribute to better resource utilization by maintaining a balanced distribution of applications across shards, preventing excessive utilization of resources on specific shards.

Proposal

The proposed implementation involves integrating the "Consistent Hash with Bounded Loads" algorithm into the Argo CD sharding mechanism. This algorithm incorporates a ring hash to determine distribution decisions while allowing dynamic updates to weights based on load conditions.

Implementation Steps:

Algorithm Integration: Integrate the Consistent Hash with Bounded Loads algorithm into the Argo CD codebase, ensuring compatibility with the existing sharding infrastructure.

  1. Weighted Shard Assignment: Implement the logic for weighted shard assignment, where the shard with the least number of applications is given a higher weight during assignment, promoting better load balancing.

  2. Dynamic Load Adjustment: Develop mechanisms for dynamically adjusting weights based on the current load conditions, ensuring adaptability to changes in the Argo CD environment.

  3. Testing and Validation: Conduct thorough testing and validation to assess the algorithm's performance under various scenarios, including changes in the number of shards, clusters, and applications.

  4. Documentation: Provide comprehensive documentation for users and administrators, explaining the benefits of the Consistent Hash with Bounded Loads algorithm and guiding users on its configuration and optimization.

Expected Outcomes

Upon successful implementation, the Consistent Hash with Bounded Loads algorithm is expected to enhance the overall scalability and efficiency of Argo CD, especially in large-scale and dynamic environments. The reduction in cluster-to-shard assignment changes and improved load balancing should contribute to a more stable and resource-efficient operation of the Argo CD system.

Conclusion

This enhancement proposal aims to contribute to the continuous improvement of Argo CD's scalability and sharding capabilities. The Consistent Hash with Bounded Loads algorithm presents a promising approach to address existing challenges and optimize the distribution of workloads within the Argo CD environment. Feedback from the community and stakeholders will be valuable in refining and finalizing the proposed implementation.

@msobkowiak-olx
Copy link

Does this still assume shards per cluster ? I can easily imagine a scenario where somebody has following setup:

  • tooling cluster (not so many apps)
  • shared cluster (many apps)
  • main monolith cluster (exactly one app)

All of them managed by centralised ArgoCD setup. I get the dynamic weighting however I think overall easier implementation is just to shard by Application Controller ID and not really care about the Cluster assignment to the application controller. You will still have a ring and we in fact already have to hint Application Controllers on number of its replicas. With this we can just shard based on number of Application Controller replicas (which always will determine the number of shards).

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

No branches or pull requests

2 participants