侧边栏壁纸
博主头像
平凡的运维之路博主等级

行动起来,活在当下

  • 累计撰写 49 篇文章
  • 累计创建 25 个标签
  • 累计收到 3 条评论

目 录CONTENT

文章目录
DB

redis 最大key数据查看

平凡的运维之路
2024-08-01 / 0 评论 / 0 点赞 / 80 阅读 / 4190 字

redis 最大key数据查看

redis 最大key数据查看

  • redis 最大key数据查看,Biggest字段查看
[redis@10-130-47-98 redis]$   ./redis-cli -p 6379 --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 '18917578050' with 12 bytes
[00.02%] Biggest hash   found so far 'LNCS-CGO_168050306730e7ab97d4b442bb' with 6 fields
[00.03%] Biggest hash   found so far 'PSS-ESALES-PFS_168050460310ca6e4d756a428b' with 7 fields
[00.09%] Biggest hash   found so far 'LCLOUD-CSP-CVMS_1680502711cba8175d532a4ec7' with 8 fields
[00.82%] Biggest hash   found so far 'c_0000050365_20230403' with 12 fields
[02.05%] Biggest string found so far 'numberwithbind' with 54 bytes
[02.75%] Biggest hash   found so far 'f_20230330' with 204 fields
[21.22%] Biggest hash   found so far 'f_20230320' with 256 fields
[30.81%] Biggest zset   found so far 'getSkillIDList:zset:0000000018' with 2 members
[35.48%] Biggest set    found so far 'interfaceAdapter_0000050388_unused_agent' with 500 members
[39.50%] Biggest set    found so far 'TEMPORARY_RECORDS' with 580 members
[44.56%] Biggest set    found so far 'interfaceAdapter_solved_requestId_set' with 21346941 members
[58.42%] Biggest hash   found so far 'interfaceAdapter_latest_phone_map' with 70952 fields
[79.14%] Biggest list   found so far 'CALLBACK_DETAIL_RECORDS' with 1361883 items
[79.42%] Biggest zset   found so far 'interfaceAdapter_requestId_zset' with 2429 members
[89.55%] Sampled 1000000 keys so far

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

Sampled 1116747 keys in the keyspace!
Total key length in bytes is 12386031 (avg len 11.09)

Biggest string found 'numberwithbind' has 54 bytes
Biggest   list found 'CALLBACK_DETAIL_RECORDS' has 1361883 items(一共多少条)
Biggest    set found 'interfaceAdapter_solved_requestId_set' has 21346941 members (一共多少条)
Biggest   hash found 'interfaceAdapter_latest_phone_map' has 70952 fields(一共多少条)
Biggest   zset found 'interfaceAdapter_requestId_zset' has 2429 members(一共多少条)

如果条数超过10W条数据时,需要重点分析查看对应key。

查看redis设定最大内存数和redis使用内存数

  • 查看redis设定最大内存数和redis使用内存数
[redis@10-130-47-98 redis]$   ./redis-cli -p 6379 
127.0.0.1:6379> info
# Memory
used_memory:3136973984
used_memory_human:2.92G  #查看当前使用内存和配置设定maxmemory,如大于1.8GB,需要注意进行分析那些应用使用key占用较高。
used_memory_rss:3189956608
used_memory_peak:3145667184
used_memory_peak_human:2.93G
used_memory_lua:24576
mem_fragmentation_ratio:1.02
mem_allocator:jemalloc-3.6.0

[redis@10-130-47-98 redis]$ vim redis.conf  #查看maxmemory参数
maxmemory 3gb
0

评论区