You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "ninsmiracle (via GitHub)" <gi...@apache.org> on 2023/06/15 06:51:30 UTC

[GitHub] [incubator-pegasus] ninsmiracle opened a new issue, #1538: Feature: support app load balance base on replicas disk usage

ninsmiracle opened a new issue, #1538:
URL: https://github.com/apache/incubator-pegasus/issues/1538

   ## Feature Request
   
   **Is your feature request related to a problem? Please describe:**
   The current load balancing strategy in Pegasus is relatively simplistic, where the balance is determined based on the number of replicas a node hosts for a particular table. The load balancing strategy treats the weights of these tables as uniform, but in reality, the disk occupancy of these shards is different. This inevitably leads to some nodes having higher disk loads while others have lower disk loads, potentially resulting in inefficient utilization of disk resources.
   
   Therefore, our goal is to achieve disk-based load balancing criteria and adjust the distribution of shards at the table level, aiming to achieve a more balanced distribution of shards across nodes for that table.
   
   **Describe the feature you'd like:**
   There are 4 new feature to finish disk usage balance:
   1.add a balance function switch,let user chose balance policy--base on replica number or replica disk usage.
   2.new way to collect every replica disk usage
   3.new app envs feature to control balance completion
   4.the corresponding new load balancing calculation method
   
   To ensure consistent functionality,load balance base on replicas disk usage need to support 'only_copy_primary'.
   
   **Describe alternatives you've considered:**
   
   *Function Switch and Dynamic Modification of Stop Threshold*
   
   This document describes a strategy parallel to the existing replica_num. Therefore, the greedy_load_balancer::greedy_balancer in greedy_balancer needs to use gflag to set the switch method for users to choose balance_policy.
   
   The disk load balancing of table dimensions can only achieve relative balance because the weight scores of all shards are no longer 1. Therefore, the final stop threshold should be that the skewness of disk occupancy for all shards in the table is less than our preset value, or the load on each disk directly reaches the desired average value. This preset value should be dynamically modifiable at the table level and is designed in the app_evns of the table.
   
   *Data Acquisition and Reporting*
   Each replica instance obtains the locally held replica disk occupancy information, and the acquisition method is to use the existing pegasus interface get_disk_space_info to obtain the disk usage of the path. This part of the collected information is divided into two parts: the occupancy of each replica and the real physical occupancy of the disk where the replica is located (there may be replicas of other tables or even other clusters). It is reported to meta through on_config_sync, so the information acquisition is not real-time and has a default delay of 90 seconds.
   
   *Data Aggregation and Load Calculation*
   Meta aggregates and organizes the replica disk load data based on tables. The aggregated data is stored in the global_view structure and is periodically synchronized to meta through on_config_sync, and then passed as parameters through check_all_partition to the balance function.
   In the load balancing logic based on replica_num, copy_primary has two parts: move_primary. Its preliminary steps include building a maximum flow graph and calculating the shortest path. However, in the load balancing strategy based on disk capacity, role switching does not improve the disk of the replica, so I have removed the logic of move_primary here.
   That is, in the table-level implementation strategy of disk load balancing, there are only two steps: copy_primary and copy_secondary. The only difference between the two is the scope of calculation. Copy_primary is prioritized because the primary_replica in Pegasus plays the role of the first point of contact for read and write operations, and it is important to prioritize the balance of the primary replica.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


[GitHub] [incubator-pegasus] ninsmiracle commented on issue #1538: Feature: support app load balance base on replicas disk usage

Posted by "ninsmiracle (via GitHub)" <gi...@apache.org>.
ninsmiracle commented on issue #1538:
URL: https://github.com/apache/incubator-pegasus/issues/1538#issuecomment-1592491477

   ![disk_usage_load_balance](https://github.com/apache/incubator-pegasus/assets/110282526/780e65e9-45b2-4660-bed6-2897e33d2666)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org


[GitHub] [incubator-pegasus] ninsmiracle commented on issue #1538: Feature: support app load balance base on replicas disk usage

Posted by "ninsmiracle (via GitHub)" <gi...@apache.org>.
ninsmiracle commented on issue #1538:
URL: https://github.com/apache/incubator-pegasus/issues/1538#issuecomment-1593001981

   ![balance_policy_graph drawio](https://github.com/apache/incubator-pegasus/assets/110282526/2d207513-e963-4545-9334-135f54bfdb92)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org