Before Redis 4.0
以下测试环境为Ubuntu 16.04 LTS
:
- 安装
Python
- 安装
Pip
- 安装
rdbtools
:pip install rdbtools python-lzf
After Redis 4.0
直接使用memory usage key
命令:
yyc16@ubuntu:~$ redis-cli -p 6379
127.0.0.1:6379> set name yyc
OK
127.0.0.1:6379> memory usage name
(integer) 51
Reference
- redis-rdb-tools
- finding out the memory occupied by a single key in redis
- Redis: Show database size/size for keys
一位喜欢提问、尝试的程序员
(转载本站文章请注明作者和出处 姚屹晨-yaoyichen)