UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
    • Install Ultipa
    • Install Ultipa Manager
  • Deployment with Kubernetes
  • Standalone Mode
  • License
    • Meta Servers
    • Shard Servers
    • HDC Servers
    • Vector Servers
    • Server Statistics
    • Privilege
    • Role (Policy)
    • User
    • Resource Group
  • Configuration
  • Monitoring
  • Security
  • Backup and Restore
  • Auto-Sharding Rebalancing
  • Change Data Capture (CDC)
  1. Docs
  2. /
  3. Operations & Maintenance

Auto-Sharding Rebalancing

Overview

Auto-sharding rebalancing is a background monitor that detects data imbalance across shards and automatically triggers data migration to rebalance the cluster. The monitor runs on the Meta Server leader and is disabled by default. It can be enabled and configured per graph.

Enabling Auto-Rebalance

To enable auto-rebalance for a graph:

GQL
ALTER GRAPH social SET AUTO_REBALANCE = {
    enabled: true,
    data_imbalance_threshold: 0.3,
    disk_usage_threshold: 0.85,
    cooldown_seconds: 3600,
    strategy: "balance"
}
Parameter
DefaultDescription
enabledfalseEnables or disables the auto-rebalance monitor.
data_imbalance_threshold0.3Triggers rebalance when (max - min) / avg across shards exceeds this threshold.
disk_usage_threshold0.85Triggers rebalance when any shard's disk usage exceeds this percentage.
cooldown_seconds3600Minimum time in seconds between consecutive rebalance triggers.
strategybalanceRebalance strategy: balance, quickly_expand, or quickly_shrink.

Showing Auto-Rebalance Status

GQL
SHOW AUTO_REBALANCE

Returns the following fields for each configured graph:

Field
Description
graphThe graph name.
enabledWhether auto-rebalance is enabled.
data_imbalance_thresholdConfigured data imbalance threshold.
disk_usage_thresholdConfigured disk usage threshold.
cooldown_secondsConfigured cooldown period.
strategyConfigured rebalance strategy.
last_trigger_timeTime of the last rebalance trigger.
current_imbalance_ratioCurrent data imbalance ratio across shards.

Disabling Auto-Rebalance

GQL
ALTER GRAPH social DROP AUTO_REBALANCE

Trigger Conditions

Rebalance is triggered when either of the following conditions is met:

  1. Data imbalance ratio exceeds data_imbalance_threshold.
  2. Disk usage on any shard exceeds disk_usage_threshold.

Safety Guards

  • Rebalance is not triggered during GRAPH_SCALING, GRAPH_LOADING_SNAPSHOT, or GRAPH_CREATING states.
  • Single-shard graphs are skipped.
  • Manual ALTER GRAPH operations pause auto-rebalance; monitoring resumes after the manual operation completes.
  • On Meta Server leader failover, the new leader resumes monitoring.

Strategies

StrategyDescription
balanceRedistributes data evenly across all available shards.
quickly_expandExpands data to additional shards when disk usage is high.
quickly_shrinkConsolidates data to fewer shards.