随着时间流逝,redis内存逐步增大,需要对redis内存进行清理,发现问题,解决问题。
bigkeys
命令用于识别在 Redis 数据库中占用最多内存的键。
对服务有一定开销,在使用系统低峰期操作。
redis-cli -c -h 127.0.0.1 -p 7021 --bigkeys
# Scanning the entire keyspace to find biggest keys as well as
# average sizes per key type. You can use -i 0.1 to sleep 0.1 sec
# per 100 SCAN commands (not usually needed).
[00.00%] Biggest string found so far '"xxx22"' with 172 bytes
[00.45%] Biggest hash found so far '"xx111"' with 1 fields
....
[06.72%] Biggest list found so far '"lizzList"' with 1 items
...
[39.70%] Biggest set found so far '"setlizz:20"' with 8 members
[50.22%] Biggest hash found so far '"hashlizz:123123"' with 2480 fields
[85.93%] Biggest string found so far '"string111:12321312"' with 445240 bytes
[95.07%] Biggest zset found so far '"lizzZset"' with 30 members
-------- summary -------
Sampled 32329 keys in the keyspace!
Total key length in bytes is 1496560 (avg len 46.29)
Biggest list found '"lizzList"' has 1 items
Biggest hash found '"hashlizz:123123"' has 2480 fields
Biggest string found '"string111:12321312"' has 445240 bytes
Biggest set found '"setlizz:20"' has 8 members
Biggest zset found '"lizzZset"' has 30 members
4 lists with 4 items (00.01% of keys, avg size 1.00)
329 hashs with 3956 fields (01.02% of keys, avg size 12.02)
31922 strings with 6028942 bytes (98.74% of keys, avg size 188.86)
0 streams with 0 entries (00.00% of keys, avg size 0.00)
16 sets with 27 members (00.05% of keys, avg size 1.69)
58 zsets with 237 members (00.18% of keys, avg size 4.09)
[95.07%] Biggest zset found so far '"lizzZset"' with 30 members
Sampled 32329 keys in the keyspace!
Total key length in bytes is 1496560 (avg len 46.29)
Biggest list found '"lizzList"' has 1 items
Biggest hash found '"hashlizz:123123"' has 2480 fields
Biggest string found '"string111:12321312"' has 445240 bytes
Biggest set found '"setlizz:20"' has 8 members
Biggest zset found '"lizzZset"' has 30 members
31922 strings with 6028942 bytes (98.74% of keys, avg size 188.86)
原文地址:https://blog.csdn.net/lizz861109/article/details/135977585
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_64587.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!