![Forrest logo](/images/logo.png)
redis-benchmark:tldr:9581b
The redis-benchmark
command is used to measure the performance of a Redis server by simulating multiple client connections and executing various Redis commands in parallel. It is a built-in tool provided by Redis for benchmarking purposes.
When you run the redis-benchmark
command, you specify the Redis server's address and port to establish connections and start sending commands. Additionally, you can define the number of parallel connections to maintain, the number of total requests to execute per connection, and the type of Redis commands to be used for benchmarking.
Some of the available options with the redis-benchmark
command are:
-h
or--host
: Specify the Redis server hostname (default is 127.0.0.1).-p
or--port
: Specify the Redis server port (default is 6379).-c
or--clients
: Define the number of parallel connections to create (default is 50).-n
or--requests
: Set the total number of requests to be sent per connection (default is 100000).-t
or--threads
: Define the number of threads to use for query pipeline (default is 1).-r
or--randomkey
: Use random keys instead of incrementing numeric keys.-q
or--quiet
: Run the benchmark in quiet mode, only showing the result.-s
or--size
: Set the payload size for SET/GET value in bytes (default is 3).
The output of the redis-benchmark
command provides various statistics such as the throughput (requests per second), average latency, minimum and maximum latencies, and so on. These statistics help in evaluating and comparing the performance of different Redis configurations or hardware setups.
The redis-benchmark
command is often used to test and tune the performance of a Redis deployment, determine the maximum capacity it can handle, or compare the performance of different Redis setups.