search

Home  >  Q&A  >  body text

redis如何获取某个db的内存占用大小?

注意,我要获取的不是整体的内存占用大小,也不是key的个数,而是实际的内存占用大小,前两者都有现成命令可以解决,但是后者貌似还没有相关命令。

黄舟黄舟2829 days ago836

reply all(1)I'll reply

  • 黄舟

    黄舟2017-04-22 08:58:31

    I think this problem can probably be solved with the answer to this sf question.

    TL;DR It is not feasible to start with the redis command. If you really want to, change the redis source code. However, in practice, you should not use too many dbs. One is enough. Judging from the various memory usage of redis, it should be enough.

    reply
    0
  • Cancelreply