Home > System Tutorial > LINUX > body text

Analyzing RedisLive: Redis's visual graph monitoring platform

WBOY
Release: 2024-01-01 16:02:43
forward
892 people have browsed it

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:

详解Redis 可视化图形监控界面 RedisLive

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
Copy after login

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
Copy after login

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.com
Copy after login
run

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:

详解Redis 可视化图形监控界面 RedisLive

  • RedisServers: List of monitored Redis instances, RedisLive supports monitoring multiple Redis instances at the same time
  • RedisStatsServer: Redis instance used to store monitoring data. This configuration is different from RedisServers. RedisLive does not monitor RedisStatsServer. RedisStatsServer is only used to store monitoring data.
  • DataStoreType: The storage solution for monitoring data, which can be configured as redis or sqlite
  • SqliteStatsStore: sqlite configuration for storing monitoring data

The redis-live.conf (need to remove the .example suffix) used by our instance is set as follows:

详解Redis 可视化图形监控界面 RedisLive

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
Copy after login

Next start the web server:

./redis-live.py
Copy after login

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.

详解Redis 可视化图形监控界面 RedisLive

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 materials
  1. https://github.com/nkrode/RedisLive
  2. http://www.nkrode.com/article/real-time-dashboard-for-redis
  3. http://wxmimperio.tk/2016/02/25/Redis-Monitor-Tools/
  4. In-depth understanding of Redis, written by Jeremy Nelson, translated by Wang Jianan, Electronic Industry Press, April 2017
  5. http://redis.io/commands/monitor

The 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!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template