cd /tmp
yum install -y git
git clone https://github.com/facebookarchive/redis-faina.git
1,redis MONITOR命令以及管道进行分
#/usr/local/redis3210/bin/redis-cli -p 6000 MONITOR | head -n 10000 | /tmp/redis-faina/redis-faina.py
2,读取日志分析
/usr/local/redis3210/bin/redis-cli -p 6000 MONITOR >/tmp/6.log
[root@REDIS redis-faina]# /tmp/redis-faina/redis-faina.py /tmp/6.log
Overall Stats
========================================
Lines Processed 14200
Commands/Sec 339.78
Top Prefixes
========================================
apps 1561 (10.99%)
MONITOR 336 (2.37%)
Top Keys
========================================
apps:expirations:1575018960000 122 (0.86%)
SEO_POINT_WORD 87 (0.61%)
HOT_SEARCH_WORD 77 (0.54%)
apps:sessions:f77b54cd-2f60-4b55-a8dc-92258bd39033 47 (0.33%)
MONITOR:POINTS:REQUEST:apps-whale-web-auth_1568012322654 42 (0.30%)
MONITOR:POINTS:REQUEST:apps-whale-web-trading_1569485813645 42 (0.30%)
MONITOR:POINTS:REQUEST:apps-whale-web-information_1573724304192 42 (0.30%)
MONITOR:POINTS:REQUEST:apps-whale-web-trading_1569485858335 42 (0.30%)
Top Commands
========================================
GET 5347 (37.65%)
HGETALL 4505 (31.73%)
PING 2154 (15.17%)
EXISTS 455 (3.20%)
INFO 444 (3.13%)
SETEX 338 (2.38%)
PEXPIRE 252 (1.77%)
TIME 175 (1.23%)
Command Time (microsecs)
========================================
Median 137.75
75% 2984.0
90% 5762.0
99% 45096.0
Heaviest Commands (microsecs)
========================================
GET 22907146.5
TIME 3463474.25
SETEX 2997799.0
PING 2574064.25
INFO 2412275.0
HVALS 2030420.75
PUBLISH 1645033.25
HGETALL 1587114.5
Slowest Calls
========================================
400681.0 "INFO"
337819.0 "GET" "pc_cityjxRegular"
326061.0 "KEYS" "cloudProduct_*"
320633.0 "PING"
297111.0 "KEYS" "cloudProduct_*"
289979.0 "KEYS" "cloudProduct_*"
280839.75 "TIME"
263656.0 "SETEX" "MONITOR:POINTS:REQUEST:apps-whale-web-trading_1569485858335" "60" "\t\x04"
You have mail in /var/spool/mail/root