redis-rdb-tools icon indicating copy to clipboard operation
redis-rdb-tools copied to clipboard

key bytes is bigger than redis memory used

Open VGHAZ opened this issue 9 years ago • 4 comments

I use redis-memory-for-key to analyse a key and find the bytes of the key is 589M. But my redis memory used just only 502M. I wonder the meaning of bytes of a key.

VGHAZ avatar Oct 26 '16 03:10 VGHAZ

Can you please share some details about your key? what type is it?, what encoding (OBJECT ENCODING key)?, number of fields or elements in the key, and if you know their sizes. what redis version are you using? version and architecture (32bit or 64bit)?

can you try modifying redis_memory_for_key.py and pass your correct redis version to the redis_version argument of MemoryCallback?

oranagra avatar Oct 26 '16 05:10 oranagra

Thanks for replying.

it is a sorted set with 3801696 members. My redis version is 3.2.4.

I can't find where is the redis_memory_for_key.py. Can you tell me where to find it?

default

VGHAZ avatar Oct 26 '16 16:10 VGHAZ

looks like you're already using the right version (by default it calculates memory usage of redis 3.2), so there's no need to edit that script. anyway, it looks like the memory estimations for sorted sets are inaccurate. they need to be improved, but i don't currently have time to handle that, so it may take time..

oranagra avatar Oct 26 '16 17:10 oranagra

Got it.

Thanks for replying, wait for your good news : ).

VGHAZ avatar Oct 31 '16 04:10 VGHAZ