简体   繁体   中英

Redis MEMORY USAGE & INFO MEMORY

MEMORY USAGE KEY gives the memory in bytes that key is taking( https://redis.io/commands/memory-usage )

If I sum up the values returned by the command by all of the keys in redis, should it sum up to one of the memory stats returns from INFO MEMORY?

If yes. Which one would it be?

  1. used_memory_rss
  2. used_memory_rss_human
  3. used_memory_dataset

No, even if you sum up that output from MEMORY USAGE , you will not get to the sums reported by INFO MEMORY .

MEMORY USAGE attempts to estimate the memory usage associated with a given key - the data but also its overheads.

used_memory_rss is the amount of memory allocated, inclusive of server overheads and fragmentation.

used_memory_dataset attempts to account for the data itself, without overheads.

So, roughly: used_memory_dataset < sum of MEMORY USAGE < used_memory_rss

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM