Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-17707

New More Accurate Table Skew cost function/generator

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: In Progress
    • Minor
    • Resolution: Unresolved
    • 1.2.0
    • None
    • Balancer
    • None
    • CentOS Derivative with a derivative of the 3.18.43 kernel. HBase on CDH5.9.0 with some patches. HDFS CDH 5.9.0 with no patches.

    • Reviewed
    • Hide
      There are now new table skew cost functions and table skew candidate generators in the stochastic load balancer to more evenly spread tables across the cluster. Table skew cost is computed per table, and the final table skew cost number is a weighted average of the maximum skew cost for a given table with the average skew cost across all tables. To configure how much weight the maximum skew cost for a single table should get, you can change "hbase.master.balancer.stochastic.maxTableSkewWeight" to a float between 0.0 and 1.0, where 0.0 means the max table skew gets 0% of the weight and 1.0 means max table skew gets 100% of the weight. This value is useful if you want to strongly penalize any one table being skewed (even if all others are evenly balanced). We default this value to 0.0 because this works best for most cases in practice.
      Show
      There are now new table skew cost functions and table skew candidate generators in the stochastic load balancer to more evenly spread tables across the cluster. Table skew cost is computed per table, and the final table skew cost number is a weighted average of the maximum skew cost for a given table with the average skew cost across all tables. To configure how much weight the maximum skew cost for a single table should get, you can change "hbase.master.balancer.stochastic.maxTableSkewWeight" to a float between 0.0 and 1.0, where 0.0 means the max table skew gets 0% of the weight and 1.0 means max table skew gets 100% of the weight. This value is useful if you want to strongly penalize any one table being skewed (even if all others are evenly balanced). We default this value to 0.0 because this works best for most cases in practice.
    • Patch

    Description

      This patch includes new version of the TableSkewCostFunction and a new TableSkewCandidateGenerator.

      The new TableSkewCostFunction computes table skew by counting the minimal number of region moves required for a given table to perfectly balance the table across the cluster (i.e. as if the regions from that table had been round-robin-ed across the cluster). This number of moves is computer for each table, then normalized to a score between 0-1 by dividing by the number of moves required in the absolute worst case (i.e. the entire table is stored on one server), and stored in an array. The cost function then takes a weighted average of the average and maximum value across all tables. The weights in this average are configurable to allow for certain users to more strongly penalize situations where one table is skewed versus where every table is a little bit skewed. To better spread this value more evenly across the range 0-1, we take the square root of the weighted average to get the final value.

      The new TableSkewCandidateGenerator generates region moves/swaps to optimize the above TableSkewCostFunction. It first simply tries to move regions until each server has the right number of regions, then it swaps regions around such that each region swap improves table skew across the cluster.

      We tested the cost function and generator in our production clusters with 100s of TBs of data and 100s of tables across dozens of servers and found both to be very performant and accurate.

      Attachments

        1. HBASE-17707-00.patch
          28 kB
          Kahlil Oppenheimer
        2. HBASE-17707-01.patch
          36 kB
          Kahlil Oppenheimer
        3. HBASE-17707-02.patch
          30 kB
          Kahlil Oppenheimer
        4. HBASE-17707-03.patch
          31 kB
          Kahlil Oppenheimer
        5. HBASE-17707-04.patch
          31 kB
          Kahlil Oppenheimer
        6. HBASE-17707-05.patch
          31 kB
          Kahlil Oppenheimer
        7. HBASE-17707-06.patch
          4 kB
          Kahlil Oppenheimer
        8. HBASE-17707-07.patch
          32 kB
          Kahlil Oppenheimer
        9. HBASE-17707-08.patch
          2 kB
          Kahlil Oppenheimer
        10. test-balancer2-13617.out
          78 kB
          Ted Yu
        11. HBASE-17707-09.patch
          32 kB
          Kahlil Oppenheimer
        12. HBASE-17707-11.patch
          32 kB
          Kahlil Oppenheimer
        13. HBASE-17707-11.patch
          1 kB
          Kahlil Oppenheimer
        14. HBASE-17707-12.patch
          32 kB
          Kahlil Oppenheimer
        15. HBASE-17707-13.patch
          38 kB
          Kahlil Oppenheimer
        16. HBASE-17707-14.patch
          41 kB
          Kahlil Oppenheimer

        Issue Links

          Activity

            People

              kahliloppenheimer Kahlil Oppenheimer
              kahliloppenheimer Kahlil Oppenheimer
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated: