|
| 1 | +# redis-benchmark-go |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This repo contains code to mimic redis-benchmark capabilities in go solely for OSS redis cluster. |
| 6 | + |
| 7 | +## Installation |
| 8 | + |
| 9 | +The easiest way to get and install the Subscriber Go program is to use |
| 10 | +`go get` and then `go install`: |
| 11 | +```bash |
| 12 | +# Fetch this repo |
| 13 | +go get github.com/filipecosta90/redis-benchmark-go |
| 14 | +cd $GOPATH/src/github.com/filipecosta90/redis-benchmark-go |
| 15 | +make |
| 16 | +``` |
| 17 | + |
| 18 | +## Usage of redis-benchmark-go |
| 19 | + |
| 20 | +``` |
| 21 | +$ redis-benchmark-go --help |
| 22 | +Usage of redis-benchmark-go: |
| 23 | + -a string |
| 24 | + Password for Redis Auth. |
| 25 | + -c uint |
| 26 | + number of clients. (default 50) |
| 27 | + -d uint |
| 28 | + Data size of the expanded string __data__ value in bytes. The benchmark will expand the string __data__ inside an argument with a charset with length specified by this parameter. The substitution changes every time a command is executed. (default 3) |
| 29 | + -debug int |
| 30 | + Client debug level. |
| 31 | + -h string |
| 32 | + Server hostname. (default "127.0.0.1") |
| 33 | + -l Loop. Run the tests forever. |
| 34 | + -n uint |
| 35 | + Total number of requests (default 100000) |
| 36 | + -p int |
| 37 | + Server port. (default 12000) |
| 38 | + -r uint |
| 39 | + keyspace length. The benchmark will expand the string __key__ inside an argument with a number in the specified range from 0 to keyspacelen-1. The substitution changes every time a command is executed. (default 1000000) |
| 40 | + -random-seed int |
| 41 | + random seed to be used. (default 12345) |
| 42 | +``` |
| 43 | + |
| 44 | +## Sample output - 10M commands |
| 45 | + |
| 46 | +``` |
| 47 | +$ redis-benchmark-go -p 20000 --debug 1 hset __key__ f1 __data__ |
| 48 | + Total clients: 50. Commands per client: 200000 Total commands: 10000000 |
| 49 | + Using random seed: 12345 |
| 50 | + Test time Total Commands Total Errors Command Rate p50 lat. (msec) |
| 51 | + 42s [100.0%] 10000000 0 [0.0%] 172737.59 0.17 |
| 52 | + ################################################# |
| 53 | + Total Duration 42.000 Seconds |
| 54 | + Total Errors 0 |
| 55 | + Throughput summary: 238094 requests per second |
| 56 | + Latency summary (msec): |
| 57 | + p50 p95 p99 |
| 58 | + 0.168 0.403 0.528 |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +## Sample output - running in loop mode ( Ctrl+c to stop ) |
| 63 | + |
| 64 | +``` |
| 65 | +$ redis-benchmark-go -p 20000 --debug 1 -l hset __key__ f1 __data__ |
| 66 | +Running in loop until you hit Ctrl+C |
| 67 | +Using random seed: 12345 |
| 68 | + Test time Total Commands Total Errors Command Rate p50 lat. (msec) |
| 69 | +^C 10s [----%] 2788844 0 [0.0%] 254648.64 0.16 |
| 70 | +received Ctrl-c - shutting down |
| 71 | +
|
| 72 | +################################################# |
| 73 | +Total Duration 10.923 Seconds |
| 74 | +Total Errors 0 |
| 75 | +Throughput summary: 274843 requests per second |
| 76 | +Latency summary (msec): |
| 77 | + p50 p95 p99 |
| 78 | + 0.162 0.372 0.460 |
| 79 | +``` |
0 commit comments