Home > Article > System Tutorial > Analyzing RedisLive: Redis's visual graph monitoring platform
As an open source Redis graphical monitoring tool, RedisLive provides monitoring of the memory usage of Redis instances, received client commands, number of received requests, and keys. The working principle of RedisLive is based on the INFO and MONITOR commands of Redis. The current running data of the Redis instance can be obtained by sending INFO and MONITOR commands to the Redis instance.
The graphical display interface provided by RedisLive is as shown below:
Install
RedisLive is implemented in Python and uses Tornado as its own web server. No additional compilation process is required to run RedisLive. After downloading the RedisLive code, you only need to install the dependent Python extension packages to run it directly.
You can download the latest RedisLive source code through Git:
git clone https//githup.com/kumarnitin/RedisLive.git
Go to the downloaded RedisLive directory and you can see that the Python extension packages that RedisLive depends on have been written in the requirements.txt file. The content of requirements.txt is as follows:
argparse==1.2.1 python-dateutil==1.5 redis tornado==2.1.1
Friends who are familiar with Python must also feel very familiar with the requirements.txt file. Use the following command to install the expansion package inside (specify Douban source to install faster):
pip install -r requirements.txt -i http://pypi.douban.com/simple/–trusted-host pypi.douban.comrun
After installing the dependencies, you can run RedisLive. Enter the RedisLive/src directory and you can see the redis-live.conf.example file. This file is an example configuration file for RedisLive. The content is as follows:
The redis-live.conf (need to remove the .example suffix) used by our instance is set as follows:
That is, the monitored Redis instance is 127.0.0.1:6379, and the sqlite function is used to store the monitoring data solution. The sqlite database path is
db/redislive.sqlite
After the configuration is complete, you can run RedisLive. The operation of RedisLive consists of two parts (in the RedisLive/src directory), redis-monitor.py is used to send INFO and MONITOR commands to the Redis instance and obtain their returns, redis-live.pyUsed to run the web server.
We first start the redis-monitor.py script and set the duration parameter to 120 seconds. The duration parameter specifies the running duration of the monitoring script. For example, if it is set to 120 seconds, that is, after 120 seconds, the monitoring script will automatically exit and print the shutting down... prompt on the terminal.
./redis-monitor.py --duration=120
Next start the web server:
./redis-live.py
Open the browser, enter http://localhost:8888/index.html in the address bar, and press Enter to see the monitoring data of the Redis instance.
It should be pointed out that since the redis-monitor.py script uses MONITOR commands and INFO commands to the Redis instance to obtain monitoring data, the MONITOR command has a greater impact on the performance of the Redis instance. , Therefore, for the deployment of redis-monitor.py in the production environment, you need to set a more appropriate duration parameter and use crontab to execute the script regularly.
Reference materialsThe above is the detailed content of Analyzing RedisLive: Redis's visual graph monitoring platform. For more information, please follow other related articles on the PHP Chinese website!