Redis performance testing is accomplished by executing multiple commands at the same time.
Grammar
The basic commands for Redis performance testing are as follows:
Redis-[option][option value]
Instance
The following instances perform 10,000 requests at the same time to detect performance:
Redis-Benchmark-N10000Ping_inline: 141043.72Requests per Secondping_bulk: 142857.14Requests per Secondset: 141442.72Requests per Secondget: 145348.83Requests per SECONDINCR: 137362.64Requests per Secondlpush: 145348.83Requests per Secondlpop: 146198.83Requests per Secondsadd: 146198.83Requests per Secondspop: 149253.73Requests per Secondlpush(needed to benchmark Lrange): 148588.42Requests per secondlrange_100(First100Elements): 58411.21Requests per secondlrange_300 (first 300 Elements 21195.42 requests per secondlrange_500 ( Span class= "PLN" >first 450 Elements): Span class= "lit" >14539.11 requests per secondlrange_600 ( First 600 Elements): 10504.20 requests per Secondmset (10 keys< Span class= "pun"): 93283.58 requests per second
The optional parameters for the Redis Performance test tool are as follows:
Serial Number |
Options |
Description |
Default Value |
1 |
-H |
Specify the server host name |
127.0.0.1 |
2 |
-P |
Specify server port |
6379 |
3 |
-S |
Specify the server socket |
|
4 |
-C |
Specify number of concurrent connections |
50 |
5 |
-N |
Specify the number of requests |
10000 |
6 |
-D |
Specifies the data size of the Set/get value as a byte |
2 |
7 |
-K |
1=keep Alive 0=reconnect |
1 |
8 |
-R |
SET/GET/INCR using random key, sadd using random values |
|
9 |
-P |
Transfer <numreq> request via pipelines |
1 |
10 |
-Q |
Force quit Redis. Show only query/sec values |
|
11 |
--csv |
Output in CSV format |
|
12 |
-L |
Build loops, perform tests permanently |
|
13 |
-T |
Only run a comma-delimited list of test commands. |
|
14 |
-I. |
Idle mode. Open only N idle connections and wait. |
|
Instance
The following example uses several parameters to test Redis performance:
redis-benchmark Span class= "pun" >-h 127.0. 0.1 -p 6379-t set,lpush -n 10000 - qset: 146198.83: 145560.41
In the example above, the host is 127.0.0.1, the port number is 6379, the command executed is Set,lpush, the number of requests is 10000, and with the-Q parameter, the result shows only the number of requests executed per second.
Redis Performance Test