Environment Introduction:
System: ubuntu14.04
Redis version: redis-2.8.24
Monitoring tools: Redis Live, Redis-stat
Redis Installation
- Wget-c http://download.redis.io/releases/redis-2.8.24.tar.gz
- Tar zxmf redis-2.8.24.tar.gz
- Mkdir-pv/opt/redis/{etc,logs}/export/redis/data
- CD redis-2.8.24/&&make && make Prefix=/opt/redis/install
Vim/opt/redis/etc/redis.conf
Daemonize Yes
Pidfile/var/run/redis.pid
Port 6379
Timeout 0
Tcp-backlog 10240
Tcp-keepalive 0
LogLevel Warning
Logfile/opt/redis/logs/redis.log
Databases 16
Save 900 1
Save 300 10
Save 60 10000
Stop-writes-on-bgsave-error Yes
Rdbcompression Yes
Dbfilename Dump.rdb
Dir/export/redis/data
MaxClients 10000
Maxmemory-policy VOLATILE-LRU
Maxmemory-samples 3
AppendOnly Yes
Appendfilename appendonly.aof
Appendfsync everysec
No-appendfsync-on-rewrite No
Auto-aof-rewrite-percentage 10000
Auto-aof-rewrite-min-size 20000MB
Lua-time-limit 5000
Slowlog-log-slower-than 10000
Slowlog-max-len 128
Hash-max-ziplist-entries 512
Hash-max-ziplist-value 64
List-max-ziplist-entries 512
List-max-ziplist-value 64
Set-max-intset-entries 512
Zset-max-ziplist-entries 128
Zset-max-ziplist-value 64
activerehashing Yes
Client-output-buffer-limit Normal 0 0 0
Client-output-buffer-limit slave 256MB 64MB 60
Client-output-buffer-limit pubsub 32MB 8MB 60
/opt/redis/bin/redis-server/opt/redis/etc/redis.conf
Redislive
Python writes, parses query statements and has web-interface monitoring tools
Note: Long running has an impact on Redis performance
Installing Redislive
- Pip Install tornado
- Pip Install Redis
- Pip Install Python-dateutil
git clone Live Project
git clone https://github.com/kumarnitin/RedisLive.git
Conf configuration
CD src
Vim redis-live.conf
{ "RedisServers": [ { "server" : "你的Redis IP地址", "port" : 6379 } ........ 可以多个 ], "DataStoreType" : "redis", "RedisStatsServer": { "server" : "你的Redis 监控IP地址", "port" : 6379 }, "SqliteStatsStore" : { "path": "to your sql lite file" }}
Start monitoring script, monitor 120 seconds, duration parameter is in seconds
./redis-monitor.py-duration=120
Start webserver.
Redislive uses tornado as a Web server, so you do not need to install the server separately
Tornado Web Server is a very lightweight, highly scalable, and non-blocking IO software that is written using Python
./redis-live.py
Http://ip:8888/index.html
Redisstat
A ruby-based program for monitoring Redis, which uses the info command to get information instead of using monitor, should perform better than monitor.
Official website: https://github.com/junegunn/redis-stat
Ruby Environment Installation
Apt-get Install Ruby
Apt-get Install RubyGems
Redis-stat Installation:
Gem Install Redis-stat
If you have an error, upgrade Ruby.
Use
Command-line mode
Redis-stat localhost:6379 1 10
Web interface mode
redis-stat-verbose-server=8080 5
?
Redis Monitoring Tools