CLUSTER SLOT-STATS

CLUSTER SLOT-STATS <SLOTSRANGE start-slot end-slot | ORDERBY metric
  [LIMIT limit] [ASC | DESC]>
Available since:
Redis Open Source 8.2.0
Time complexity:
O(N) where N is the total number of slots based on arguments. O(N*log(N)) with ORDERBY subcommand.
Compatibility:
Redis Software and Redis Cloud compatibility

Use this command to get an array of slot usage statistics for the slots assigned to the current shard. If you're working with a Redis cluster, this data helps you understand overall slot usage, spot hot or cold slots, plan slot migrations to balance load, or refine your application logic to better distribute keys.

Required arguments

Specify exactly one of the following to select which slots to report on.

SLOTSRANGE start-slot end-slot

Limits the results to a specific, inclusive range of slots. Results are always sorted by slot number in ascending order.

ORDERBY metric [LIMIT limit] [ASC | DESC]

Sorts the slot statistics by the specified metric. Use ASC or DESC to sort in ascending or descending order, and LIMIT to limit the number of results returned. If multiple slots have the same value, the command uses the slot number as a tiebreaker, sorted in ascending order.

metric is one of the statistics reported for each slot:

  • KEY-COUNT: Number of keys stored in the slot.
  • CPU-USEC: CPU time (in microseconds) spent handling the slot.
  • MEMORY-BYTES: Number of bytes allocated by the slot.
  • NETWORK-BYTES-IN: Total inbound network traffic (in bytes) received by the slot.
  • NETWORK-BYTES-OUT: Total outbound network traffic (in bytes) sent from the slot.
Note:
All metrics except KEY-COUNT require that cluster-slot-stats-enabled is set to yes in the redis.conf file.

Redis Software and Redis Cloud compatibility

Redis
Software
Redis
Cloud
Notes
❌ Standard
❌ Active-Active
❌ Standard
❌ Active-Active

Return information

One of the following:

RATE THIS PAGE
Back to top ↑