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-benchmark [option] [option value]
Instance
The following instances perform 10,000 requests at the same time to detect performance:
- Redis-Benchmark -n 100000
- Ping_inline: 141043.72 requests per second
- Ping_bulk: 142857.14 requests per second
- SET: 141442.72 requests per second
- GET: 145348.83 requests per second
- INCR: 137362.64 requests per second
- Lpush: 145348.83 requests per second
- Lpop: 146198.83 requests per second
- Sadd: 146198.83 requests per second
- SPOP: 149253.73 requests per second
- Lpush (needed to benchmark Lrange): 148588.42 requests per second
- Lrange_100 (first elements): 58411.21 requests per second
- lrange_300 (first elements): 21195.42 requests per second
- lrange_500 (first elements): 14539.11 requests per second
- lrange_600 (first elements): 10504.20 requests per second
- MSET ( keys): 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 requests through pipelines <numreq> |
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 -H 127.0. 0.1 -p 6379 -t set,lpush -n 100000 -Q
- SET: 146198.83 requests per second
- Lpush: 145560.41 requests per second
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