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

kvserver: introduce cpu rebalancing #96127

Merged
merged 3 commits into from
Feb 9, 2023

Commits on Feb 9, 2023

  1. kvserver: pass load dimension to test load ranges

    Previously `Queries` was hardcoded as the dimension to use when creating
    test ranges for use in store rebalancer tests. This patch enables
    passing in any `dimension`.
    
    Release note: None
    kvoli committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    a766bc8 View commit details
    Browse the repository at this point in the history
  2. kvserver: refine est impact for lease transfers

    Previously, when estimating the impact a lease transfer would have, we
    would not differentiate between rebalance/transfer. This commit adds a
    utility method `TransferImpact` to `RangeUsageInfo` which is now used
    when making estimations about lease transers.
    
    Currently, this is identical to `Load`, which was previously used
    instead for transfers.
    
    Release note: None
    kvoli committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    1529670 View commit details
    Browse the repository at this point in the history
  3. kvserver: introduce cpu rebalancing

    This patch allows the store rebalancer to use CPU in place of QPS when
    balancing load on a cluster. This patch adds `cpu` as an option with the
    cluster setting:
    
    `kv.allocator.load_based_rebalancing.objective`
    
    When set to `cpu`, rather than `qps`. The store rebalancer will perform
    a mostly identical function, however, it will target balancing the sum
    of all replica's cpu time on each store, rather than qps. The default
    remains as `qps` here.
    
    Similar to QPS, the rebalance threshold can be set to allow controlling
    the range above and below the mean store CPU is considered imbalanced,
    either overfull or underfull respectively:
    
    `kv.allocator.cpu_rebalance_threshold`: 0.1
    
    In order to manage with mixed versions during upgrade and some
    architectures not supporting the cpu sampling method, a rebalance
    objective manager is introduced in `rebalance_objective.go`. The manager
    mediates access to the rebalance objective and overwrites it in cases
    where the objective set in the cluster setting cannot be supported.
    
    resolves: cockroachdb#95380
    
    Release note (ops change): Add option to balance cpu time (cpu)
    instead of queries per second (qps) among stores in a cluster. This is
    done by setting `kv.allocator.load_based_rebalancing.objective='cpu'`.
    `kv.allocator.cpu_rebalance_threshold` is also added, similar to
    `kv.allocator.qps_rebalance_threshold` to control the target range for
    store cpu above and below the cluster mean.
    kvoli committed Feb 9, 2023
    Configuration menu
    Copy the full SHA
    c28ed6b View commit details
    Browse the repository at this point in the history