The article directories

  • redis-benchmark
  • The command parameter
  • Test the sample

redis-benchmark


Redis-benchmark is an official performance test tool. You can set relevant parameters to test performance.

The command parameter


options describe The default value
-h Specify the server host name 127.0.0.1
-p Specify server port 6379
-s Specify server socket
-c Specifies the number of concurrent connections 50
-n Specify number of requests 10000
-d Specifies the data size of a SET/GET value in bytes 3
-k 1=keep alive 0=reconnect 1
-r SET/GET/INCR uses random keys and SADD uses random values
-P The request is piped 1
-q Forced exit from Redis. Only query/ SEC values are displayed
– the CSV Output in CSV format
-l Generate a loop that executes the test permanently
-t Run only a comma-separated list of test commands.
-I Idle mode. Open only N IDLE connections and wait.

Test the sample


See the previous blog post for the Redis installation

First connect to Redis



Input test commands and set related parameters.

redis-benchmark -c 100 -n 100000
Copy the code

Results interpretation, take SET as an example

Feel the Redis is really fast

Original is not easy, please do not reprint (this is not rich visits add insult to injury) blogger home page: blog.csdn.net/qq_45034708 If the article is helpful to you, remember to focus on the likes collection ❤