关于如何解决(AWS ElastiCache (REDIS)
)存在的问题,我有两个选择。
我能够找到这两种方法在时间复杂度(Big O)和其他方面的所有差异。
但是,仍然有一个问题困扰我:
REDIS群集在处理以下方面是否有任何区别(在内存消耗,CPU或任何其他资源方面):
?
先谢谢您的帮助 :)
最佳答案
您正在比较两种不同的数据类型,最好进行基准测试,以确定使用info memory
哪个内存消耗更好。但我假设两者用于内部条目的长度相同。
如果您使用配置set-max-intset-entries
并在添加到该集合中时保持其限制(比方说512),那么您的内存消耗将低于第一个选项(相同的值长度和相等的总条目数)。但这不是免费的。
documentation指出
This is completely transparent from the point of view of the user and API. Since this is a CPU / memory trade off it is possible to tune the maximum number of elements and maximum element size for special encoded types using the following redis.conf directives.
关于redis - 数以千计的REDIS排序集VS数百万个简单集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62709495/