Redis performance test
Redis performance testing is achieved by executing multiple commands at the same time. Redis performance testing is mainly implemented through redis-benchmark in the src folder (in Linux)
Syntax
The basic commands for redis performance testing are as follows:
- Redis-benchmark [option] [option value]
Instance
The following instances simultaneously execute 10000 requests 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 100 elements): 58411.21 requests per second
- LRANGE_300 (first 300 elements): 21195.42 requests per second
- LRANGE_500 (first 450 elements): 14539.11 requests per second
- LRANGE_600 (first 600 elements): 10504.20 requests per second
- MSET (10 keys): 93283.58 requests per second
The redis performance testing tool has the following optional parameters:
Serial number |
Option |
Description |
Default Value |
1 |
-H |
Specify the server host name |
127.0.0.1 |
2 |
-P |
Specify the server port |
6379 |
3 |
-S |
Specify server socket |
|
4 |
-C |
Number of concurrent connections |
50 |
5 |
-N |
Number of requests |
10000 |
6 |
-D |
Specify the data size of the SET/GET value in bytes |
2 |
7 |
-K |
1 = keep alive 0 = reconnect |
1 |
8 |
-R |
SET/GET/INCR use random key, SADD use random Value |
|
9 |
-P |
Transfer <numreq> requests in a pipeline |
1 |
10 |
-Q |
Force exit redis. Show query/sec values only |
|
11 |
-- Csv |
Output in CSV format |
|
12 |
-L |
Generate a loop and run the test permanently |
|
13 |
-T |
Run only the list of test commands separated by commas. |
|
14 |
-I |
Idle mode. Open only N idle connections and wait. |
|
Instance
The following instances use multiple 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 above instance, the host is 127.0.0.1, the port number is 6379, the command to be executed is set, lpush, and the number of requests is 10000. Through the-q Parameter, only the number of requests executed per second is displayed.
You may also like the following articles about Redis. For details, refer:
Install and test Redis in Ubuntu 14.04
Basic configuration of Redis master-slave Replication
Redis cluster details
Install Redis in Ubuntu 12.10 (graphic explanation) + Jedis to connect to Redis
Redis series-installation, deployment, and maintenance
Install Redis in CentOS 6.3
Learning notes on Redis installation and deployment
Redis. conf
Redis details: click here
Redis: click here
This article permanently updates the link address: