Real key size

11 views
Skip to first unread message

Noam Sagi

unread,
Nov 25, 2016, 7:08:44 AM11/25/16
to redis-module-devs
How can I tell the size of a key?

I'm using 'debug object' and looking at 'serializedlength' but it seems that this info is wrong.

How can I know the real size of a key?

Salvatore Sanfilippo

unread,
Nov 25, 2016, 7:11:19 AM11/25/16
to Noam Sagi, redis-module-devs
MEMORY command in Redis >= 4.0 (currently in the "unstable" branch.
RC1 out as soon as I fix an Heisenbug with PSYNC2).
> --
> You received this message because you are subscribed to the Google Groups
> "redis-module-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to redis-module-d...@googlegroups.com.
> To post to this group, send email to redis-mo...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/redis-module-devs/edfd8d46-062f-4609-9a49-a92e58f6d790%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Salvatore 'antirez' Sanfilippo
open source developer - Redis Labs https://redislabs.com

"If a system is to have conceptual integrity, someone must control the
concepts."
— Fred Brooks, "The Mythical Man-Month", 1975.

Noam Sagi

unread,
Nov 25, 2016, 7:26:52 AM11/25/16
to Salvatore Sanfilippo, redis-module-devs
Thanks.

It works well for standard type, but crashes on my custom type. 
Should I check in my own code, or is it a current limitation?


‫בתאריך יום ו׳, 25 בנוב׳ 2016 ב-14:11 מאת ‪Salvatore Sanfilippo‬‏ <‪ant...@gmail.com‬‏>:‬

Noam Sagi

unread,
Nov 25, 2016, 7:45:55 AM11/25/16
to Salvatore Sanfilippo, redis-module-devs
Hi,

I think it doesn't work for lists as well. It shows a number ~1000x times higher than the real size...

Thanks,
Noam

‫בתאריך יום ו׳, 25 בנוב׳ 2016 ב-14:26 מאת ‪Noam Sagi‬‏ <‪sagi...@gmail.com‬‏>:‬

Salvatore Sanfilippo

unread,
Nov 25, 2016, 8:29:12 AM11/25/16
to Noam Sagi, redis-module-devs
If it crashes it's a bug, thanks. Please could you open an issue in
the Redis repo about that crash and the List issue you reported?
Thanks.
> https://groups.google.com/d/msgid/redis-module-devs/CAFSqODdLc%3D-DfsszWiY26AgANDKOaqQg0eeevHVNfKRNB_P5fA%40mail.gmail.com.

Noam Sagi

unread,
Nov 25, 2016, 8:49:00 AM11/25/16
to Salvatore Sanfilippo, redis-module-devs

‫בתאריך יום ו׳, 25 בנוב׳ 2016 ב-15:29 מאת ‪Salvatore Sanfilippo‬‏ <‪ant...@gmail.com‬‏>:‬

Salvatore Sanfilippo

unread,
Nov 25, 2016, 8:53:03 AM11/25/16
to Noam Sagi, redis-module-devs

Thanks, put in the 4.0 milestone.


>> > email to redis-module-devs+unsubscribe@googlegroups.com.
>> > To post to this group, send email to redis-module-devs@googlegroups.com.

>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/redis-module-devs/edfd8d46-062f-4609-9a49-a92e58f6d790%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Salvatore 'antirez' Sanfilippo
>> open source developer - Redis Labs https://redislabs.com
>>
>> "If a system is to have conceptual integrity, someone must control the
>> concepts."
>>        — Fred Brooks, "The Mythical Man-Month", 1975.
>
> --
> You received this message because you are subscribed to the Google Groups
> "redis-module-devs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to redis-module-devs+unsubscribe@googlegroups.com.
> To post to this group, send email to redis-module-devs@googlegroups.com.

> To view this discussion on the web visit
> https://groups.google.com/d/msgid/redis-module-devs/CAFSqODdLc%3D-DfsszWiY26AgANDKOaqQg0eeevHVNfKRNB_P5fA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
Salvatore 'antirez' Sanfilippo
open source developer - Redis Labs https://redislabs.com

"If a system is to have conceptual integrity, someone must control the
concepts."
       — Fred Brooks, "The Mythical Man-Month", 1975.

--
You received this message because you are subscribed to the Google Groups "redis-module-devs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-module-devs+unsubscribe@googlegroups.com.
To post to this group, send email to redis-module-devs@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages