Redis爆了如何定位占用最高的key有哪些

用rdbtools工具分析redis的持久化以rdb的方式存储文件

  • 找到redis的配置文件查看持久化以rdb存贮路劲

# The filename where to dump the DB dbfilename dump.rdb # The working directory. # # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # The Append Only File will also be created inside this directory. # # Note that you must specify a directory here, not a file name. dir /usr/local/var/db/redis/
  • 复制一份dump.rdb到其他目录
  • 用rdbtools工具分析

rdb -c memory /vagrant/dump.rdb > test.csv

注:( 这里dump.rdb文件越大分析处理的时间就越长 )

分析结果如下:

鲁ICP备16017569号-2