Redis-related gadgets: redis-load and redis-stat
Redis-load and redis-stat are two gadgets written by Redis author antirez:
Redis-load is a stress testing tool for Redis. redis-stat is a Redis status monitoring tool.
See https://github.com/antirez/redis-tools for relevant code
1. Download the code
$ git clone https://github.com/antirez/redis-tools.git
2 compile
$ cd redis-tools$ make all
3 redis-load
Redis-load is a Redis stress testing tool. You can view the usage in the following ways:
$ ./redis-load helpUsage: redis-load ... options ......
A simple test example:
$ ./redis-load host 127.0.0.1 port 6379PRNG seed is: 3312712080 - use the 'seed' option to reproduce the same sequence====== Report ====== 10000 requests in 0.367 seconds 27247.96 requests per second 50 parallel clients payload: 1..64 bytes keep alive: 1 4.30% < 1 ms 79.07% < 2 ms 93.99% < 3 ms 98.53% < 4 ms 99.02% < 5 ms 99.24% < 6 ms 99.45% < 8 ms 99.50% < 9 ms 99.54% < 16 ms 99.58% < 17 ms 99.63% < 18 ms 99.66% < 19 ms 99.72% < 20 ms 99.78% < 21 ms 99.84% < 22 ms 99.90% < 23 ms 99.93% < 24 ms 99.95% < 25 ms100.00% < 26 ms
4 redis-stat
Redis-stat monitors the status of Redis instances in real time, including overview, vmstat, vmpage, ondisk-size, and latency. The details are as follows:
$ ./redis-stat helpUsage: redis-stat ... options ...Statistic types: 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: host Server hostname (default 127.0.0.1) port Server port (default 6379) delay Delay between requests (default: 1000 ms, 1 second). samplesize Number of keys to sample for 'vmpage' stat. logscale User power-of-two logarithmic scale in graphs.
A simple test example:
$ ./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 the Real-Time latency of Redis instances:
$ ./redis-stat latency host 127.0.0.1 port 6379 1: 0.23 ms2: 0.67 ms3: 0.21 ms4: 0.23 ms5: 0.23 ms6: 0.16 ms7: 0.37 ms......