码迷,mamicode.com
首页 > 其他好文 > 详细

redis统计大key

时间:2019-02-24 19:03:13      阅读:499      评论:0      收藏:0      [点我收藏+]

标签:分析   col   with   ash   str   field   index   1.7   user   

–bigkeys

redis-cli -h <host> -p <port> -n <db> --bigkeys

这条命令会从指定的 Redis DB 中持续采样,实时输出当时得到的 value 占用空间最大的 key 值,并在最后给出各种数据结构的 biggest key 的总结报告:

user $ redis-cli -h myhost -p 12345 --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 hash   found so far ‘idx:同类项‘ with 1 fields
[00.00%] Biggest hash   found so far ‘idx:格点‘ with 3 fields
[00.00%] Biggest hash   found so far ‘idx:任意‘ with 14 fields
[02.29%] Biggest hash   found so far ‘idx:设‘ with 16 fields
[02.29%] Biggest hash   found so far ‘idx:4‘ with 69 fields
[04.45%] Biggest set    found so far ‘indexed_word_set‘ with 1482 members
[05.93%] Biggest hash   found so far ‘idx:c‘ with 159 fields
[11.79%] Biggest hash   found so far ‘idx:的‘ with 196 fields

-------- summary -------

Sampled 1484 keys in the keyspace!
Total key length in bytes is 13488 (avg len 9.09)

Biggest    set found ‘indexed_word_set‘ has 1482 members
Biggest   hash found ‘idx:的‘ has 196 fields

0 strings with 0 bytes (00.00% of keys, avg size 0.00)
0 lists with 0 items (00.00% of keys, avg size 0.00)
2 sets with 1710 members (00.13% of keys, avg size 855.00)
1482 hashs with 6731 fields (99.87% of keys, avg size 4.54)
0 zsets with 0 members (00.00% of keys, avg size 0.00)

这条命令给出的 "big key" ,是值得去分析一下的。

redis统计大key

标签:分析   col   with   ash   str   field   index   1.7   user   

原文地址:https://www.cnblogs.com/weifeng1463/p/10427054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!