Redis Cluster Number of Slots: Complete Configuration List
Redis Cluster divides data across 16,384 hash slots for scalability. Understanding slot allocation is key to balancing masters, minimizing migrations, and optimizing performance. This list details defaults, calculations, and best practices.
From initial setup to resharding, explore how slot count impacts your cluster's reliability and throughput.
Default Slot Configuration
- Total slots: 16,384.
- Slots per master: Variable (ideal 1000-5000).
- Hash function: CRC16 modulo 16384.
- Empty slots: Handled by --cluster-replica.
Calculating Ideal Slot Distribution
Common Slot Count Scenarios
- 3 masters: Classic setup.
- 6 masters: High availability.
- 1000+ shards: Extreme scale (rare).
- Replicas inherit slots.
Monitoring and Rebalancing Slots
- redis-cli cluster nodes.
- Check slot ownership.
- Automate with redis-trib.rb.
- Migrate 1000 slots at a time.
Troubleshooting Slot Issues
- Migrating slots fail: Check firewalls.
- Too many unassigned: Add masters.
- Performance drops: Even distribution.
- Version mismatches.
Advanced Slot Optimization
- Custom hash tags
- Pipeline optimization
Frequently Asked Questions
What is the total number of slots in Redis Cluster?
Redis Cluster always uses exactly 16,384 hash slots. This fixed number ensures consistent sharding across nodes.
How do I check slot distribution?
Use redis-cli -c -p 7000 cluster slots or cluster nodes to view ownership and ranges per master.
Can I change the number of slots?
No, the 16384 count is hardcoded for compatibility. Resharding redistributes within this limit.
What happens to slots during failover?
Replicas automatically take over slots from failed masters via gossip protocol.
How to add slots to a new node?
Use redis-cli --cluster reshard to migrate slots from existing masters.