sripathikrishnan / redis-rdb-tools

Parse Redis dump.rdb files, Analyze Memory, and Export Data to JSON
https://rdbtools.com
MIT License
5.08k stars 742 forks source link

command redis-memory-for-key is dangerous #154

Open hoswey opened 5 years ago

hoswey commented 5 years ago

As the redis-memory-for-key will call dump command of the redis

For large key, the dump command will block redis as it's Time complexity. So this command is very dangerous for production environment.

Time complexity: O(1) to access the key and additional O(NM) to serialized it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1M) where M is small, so simply O(1).