My redis instance seems to being growing very large and I\'d like to find out which of the multiple databases I have in there consumes how much memory. Redis\' INFO
So my solution to my own problem: After playing around with redis-cli
a bit longer I found out that DEBUG OBJECT <key>
reveals something like the serializedlength
of key, which was in fact something I was looking for...
For a whole database you need to aggregate all values for KEYS *
which shouldn't be too difficult with a scripting language of your choice...
The bad thing is that redis.io doesn't really have a lot of information about DEBUG OBJECT.
The solution from the comments deserves it's own answer:
redis-cli --bigkeys
MEMORY USAGE key
command gives you the number of bytes that a key and its value require to be stored in RAM.
The reported usage is the total of memory allocations for data and administrative overheads that a key its value require (source redis documentation)