Redis is widely used in the business, but it is seldom mentioned how to monitor redis and observe redis performance in real time, currently, common monitoring solutions use the info and monitor commands provided by redis to obtain relevant information and then extract the information for display.
Test environment:
Redis version: 2.4.17
IP: 10.20.111.188
1 redis-faina
A python script that uses the output result of the redis Command monitor for analysis. It can be used in the command line for real-time analysis.
Official Website: https://github.com/Instagram/redis-faina
Download trial:
Cd/opt/test
Git clone https://github.com/Instagram/redis-faina.git
Cd redis-faina/
Redis-cli-p 6379 MONITOR | head-n 100 |./redis-faina.py -- redis-version = 2.4
The test results are as follows:
You can see some real-time data and statistical data, which can be used as a command line tool. It is recommended, but the redis version must be later than 2.4.
2 redis-live
A monitoring tool that monitors redis instances, analyzes query statements, and has a web interface. It is written in python.
Official Website: https://github.com/nkrode/RedisLive
Download trial:
Run environment dependency package installation: http://www.nkrode.com/article/real-time-dashboard-for-redis
Install redis-live:
Cd/root
Git clone https://github.com/nkrode/RedisLive.git
Cd RedisLive/src
### Modify the redis-live.conf File
{
"RedisServers ":
[
{
"Server": "10.20.111.188 ",
Port: 6379
}
],
"DataStoreType": "redis ",
"RedisStatsServer ":
{
"Server": "10.20.111.188 ",
Port: 6380
},
"SqliteStatsStore ":
{
"Path": "to your SQL lite file"
}
}
### Modification completed
### Start monitoring once every 30 seconds
./Redis-monitor.py -- duration = 30
### Start a terminal again, go to the/root/RedisLive/src directory, and start the web Service
/Redis-live.py
Enter http: // 10.20.111.188: 8888/index.html in the browser:
A web interface can monitor multiple redis instances at the same time, which is better for centralized monitoring.
Redis details: click here
Redis: click here
Recommended reading:
Redis cluster details
Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis
Redis series-installation, deployment, and maintenance
Install Redis in CentOS 6.3
Redis. conf