Back to results for “Monitoring”
Redis › Cluster Sharding & Hash Slots

How do you check the current distribution of hash slots and keys across the nodes in a Redis Cluster to identify potential imbalances?

Intermediate

Answer

You use the CLUSTER SLOTS or CLUSTER SHARDS command to see exactly which node owns which range of hash slots, and combine this with checking key counts per node, to identify if certain nodes are holding significantly more data or slots than others, which could indicate an imbalance worth addressing through resharding.
redis-cli cluster slots
redis-cli -h node1 dbsize
redis-cli -h node2 dbsize
Real-world example A database administrator notices one node in their cluster holding twice as much data as the others after checking slot distribution and key counts, prompting a resharding operation to better balance the load.

Common follow-ups: What tools provide a more visual way to monitor hash slot distribution?;How often should cluster balance be checked in a production environment?