首页 文章 Why redis has 16384 slots?

Why redis has 16384 slots?

2024-09-25 16:22  浏览数:228  来源:redjujubee    

Why redis has 16384 slots?
The reason is:
Normal heartbeat packets carry the full configuration of a node, that can be replaced in
an idempotent way with the old in order to update an old config. This means they contain
the slots configuration for a node, in raw form, that uses 2k of space with16k slots, but
would use a prohibitive 8k of space using 65k slots.
At the same time it is unlikely that Redis Cluster would scale to more than 1000 mater
nodes because of other design tradeoffs.
So 16k was in the right range to ensure enough slots per master with a max of 1000 maters,
but a small enough number to propagate the slot configuration as a raw bitmap easily. Note
that in small clusters the bitmap would be hard to compress because when N is small the
bitmap would have slots/N bits set that is a large percentage of bits set.



声明:以上文章均为用户自行添加,仅供打字交流使用,不代表本站观点,本站不承担任何法律责任,特此声明!如果有侵犯到您的权利,请及时联系我们删除。

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)