Redis 命令 HMSET 字段的最大数量限制是多少?如果我通过 HMSET 将 100000 个字段设置为一个键,比较使用每个字段作为键是否会导致性能问题?
最佳答案
相当大,64位系统为2^64-1,32位系统为2^32 -1, https://groups.google.com/d/msg/redis-db/eArHCH9kHKA/UFFRkp0iQ4UJ
1) Number of keys in every Redis database: 2^64-1 in 64 bit systems. 2^32-1 in 32 bit systems. 2) Number of hash fields in every hash: 2^64-1 in 64 bit systems. 2^32-1 in 32 bit systems.
Given that a 32 bit instance has at max 4GB of addressable space, the limit is unreachable. For 64 bit instances, given how big is 2^64-1, the limit is unreachable.
So for every practical point of view consider keys and hashes only limited by the amount of RAM you have.
Salvatore
关于redis - Redis命令HMSET有字段数限制吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39265061/