1.使用bgsave dump出当前redis的内存rdb文件
2.使用 rdbtools 生成内存文件
a.安装程序 sudo pip install rdbtools
b.生成cvs文件 rdb -c memory dump.rdb > cover.cvs
cvs内容如下:
1
2
3
4
5
6
7
8
9 1database,type,key,size_in_bytes,encoding,num_elements,len_largest_element
20,string,PHPREDIS_SESSION:4l53pj0h25k0deer1m54jv1ok5,344,string,218,218
30,string,PHPREDIS_SESSION:o8pfn9nooa0spvl7b8astddrr2,344,string,218,218
40,string,PHPREDIS_SESSION:q0lqfs469t5rkn080d69mr5e10,344,string,218,218
50,string,PHPREDIS_SESSION:4eusfkcsde6oprgo9gdcqknnu1,344,string,218,218
60,string,PHPREDIS_SESSION:813974709p6fppp28q1mceobv3,344,string,218,218
70,string,PHPREDIS_SESSION:tlnhhbopqh6g2va4q2o2si0sh7,344,string,218,218
80,string,PHPREDIS_SESSION:sgustbtua8akbmm78sqvtbill5,344,string,218,218
9
3.导入mysql或其他关系型数据库进行统计查看