redis抓包分析脚本
# redis-faina.py 分析redis 一段时间的redis语句
redis-faina.py点击下载 (opens new window)
使用方法例子
[dba01@xxxtest-redis01 ~]$ redis-cli -h 172.16.9.126 -p 7001 -a xxxxxxxxxxxxxxx -c monitor |head -n 99999 >>/tmp/1201-redis.log
Warning: Using a password with '-a' or '-u' option on the command line interface may not be safe.
[dba01@xxxprod-redis01 ~]$ ls
redis-faina.py result.md
[dba01@xxxprod-redis01 ~]$ python redis-faina.py /tmp/1201-redis.log
Overall Stats
========================================
Lines Processed 99999
Commands/Sec 9302.46
[2021/12/1 17:15:57]
Top Prefixes
========================================
spring 26850 (26.85%)
blacklist 21755 (21.76%)
agentstatus 15040 (15.04%)
agentuser 12378 (12.38%)
mq 1812 (1.81%)
collaboration 1217 (1.22%)
online 374 (0.37%)
system 177 (0.18%)
[2021/12/1 17:15:57]
Top Keys
========================================
spring:session:expirations:1638353760000 7075 (7.08%)
topic_agent 3984 (3.98%)
blacklist:24ffb96385e7e7e2e96fc6ee9e5df65e 1576 (1.58%)
blacklist:77e5ff35d8120ba85a420f231f5e3a32 880 (0.88%)
blacklist:3ae188e1c602ff18e55380edb5d49586 700 (0.70%)
blacklist:4727b116cae6da03fc8a10094dc175ad 578 (0.58%)
blacklist:a9effdc4c483c681ec9813d07b6883db 464 (0.46%)
blacklist:2321910b31946566bae7a8c384afddc3 448 (0.45%)
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
上次更新: 8/28/2024
- 01
- GPT分区使用 parted 扩展分区的操作流程 原创08-28
- 02
- VictoriaMetrics 集群版安装与配置 原创08-24
- 03
- Kubernetes (k8s) 相关名词详解 原创06-27