Redis-stat is a monitoring Redis program written in Ruby that gets information based on the info command, rather than through the monitor.
First, install Ruby
Copy Code code as follows:
Yum install-y Ruby Ruby-devel RubyGems
Apt-get install RubyGems Ruby.
The intermittent connection to the resource file rubygems.org stored on Amazon S3 failed due to domestic network reasons. So you will encounter with gem install rack or bundle install when Half-day no response, so need to modify rubygems for Taobao mirror.
Ii. Replacement of RubyGems
Copy Code code as follows:
Gem sources--add https://ruby.taobao.org/--remove http://rubygems.org/
Gem Sources-l
Iii. installation of Redis-stat
Copy Code code as follows:
git clone https://github.com/junegunn/redis-stat.git
Gem Install Redis-stat
Will prompt
Building native extensions. This is could take a while ...
Building native extensions. This is could take a while ...
Building native extensions. This is could take a while ...
Error:error Installing Redis-stat:
Redis-stat requires Daemons (~> 1.1.9, runtime)
Four, uninstall daemons
Copy Code code as follows:
Gem Uninstall daemons
Gem Install daemons
Gem Install Redis-stat
Install Redis-stat also installs daemons-1.1.9, if the system is installed daemons other version, need to uninstall again
Error:error Installing Redis-stat:
Redis-stat requires Daemons (~> 1.1.9, runtime)
Copy Code code as follows:
Gem Uninstall daemons
Select Gem to uninstall:
1. daemons-1.1.9
2. daemons-1.2.3
3. All versions
> 2
Successfully uninstalled daemons-1.2.3
V. Installation of Systemtimer
Copy Code code as follows:
And then we can start Redis-stat.
Copy Code code as follows:
Redis-stat--verbose--server= ...:
Redis-stat 110.160.4.71:6379 110.47.90.168:6379 1 10
Add: Redis-stat
Redis-stat is a real-time monitoring of the status of Redis instances, including overview, Vmstat, Vmpage, ondisk-size, latency, specific information as follows:
Copy Code code as follows:
$./redis-stat Help
Usage:redis-stat <type> ... options ...
Statistic types:
Copy Code code as follows:
Overview (default) Print general information about a Redis instance.
Vmstat Print information about Redis VM activity.
Vmpage Try to guess the best vm-page-size for your dataset.
Ondisk-size Stats and graphs about values len once stored on disk.
Latency Measure Redis Server latency.
Options:
Copy Code code as follows:
Host Port Delay <milliseconds> delay between requests (default:1000 MS, 1 second).
SampleSize <keys> number of keys to sample for ' Vmpage ' Stat.
Logscale User power-of-two logarithmic scale in graphs.
A simple test example:
Copy Code code as follows:
$./redis-stat Host 127.0.0.1 Port 6379
-------data---------------------------Load---------------------child-
Keys MEM clients blocked requests connections
29602 3.45M 1 0 30090 (+0) 157
29602 3.45M 1 0 30091 (+1) 157
29602 3.45M 1 0 30092 (+1) 157
29602 3.45M 1 0 30093 (+1) 157
29602 3.45M 1 0 30094 (+1) 157
29602 3.45M 1 0 30095 (+1) 157
29602 3.45M 1 0 30096 (+1) 157
29602 3.45M 1 0 30097 (+1) 157
29602 3.45M 1 0 30098 (+1) 157
...
...
It is also useful to view real-time latency for Redis instances:
Copy Code code as follows:
$./redis-stat Latency host 127.0.0.1 Port 6379
1:0.23 ms
2:0.67 ms
3:0.21 ms
4:0.23 ms
5:0.23 ms
6:0.16 ms
7:0.37 ms
...
...