Skip to content

Redis - Benchmarks

Redis includes a built-in benchmarking utility, redis-benchmark, designed to simulate running multiple commands from multiple parallel clients. It provides a standardized way to measure the performance of your Redis instance under a synthetic load.

The basic syntax for running the benchmark utility from your terminal is:

redis-benchmark [options]

Executing redis-benchmark without any options runs a standard suite of tests using 50 parallel clients and 100,000 total requests.

$ redis-benchmark
====== PING_INLINE ======
100000 requests completed in 0.70 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.68% <= 1 milliseconds
100.00% <= 1 milliseconds
142653.36 requests per second
====== PING_BULK ======
100000 requests completed in 0.69 seconds
50 parallel clients
3 bytes payload
keep alive: 1
99.78% <= 1 milliseconds
100.00% <= 1 milliseconds
144717.80 requests per second
... (output continues for SET, GET, LPUSH, etc.) ...
====== MSET (10 keys) ======
100000 requests completed in 1.15 seconds
50 parallel clients
3 bytes payload
keep alive: 1
96.48% <= 1 milliseconds
99.88% <= 2 milliseconds
100.00% <= 2 milliseconds
87108.02 requests per second

You can tailor the benchmark to better reflect your application’s workload using various options. For example, let’s test only SET and GET commands with a larger data payload.

# -n 100000: 100,000 total requests
# -c 100: 100 parallel clients
# -d 256: 256 bytes data payload for SET/GET
# -t get,set: Only run GET and SET tests
# -q: Quiet mode, shows only req/sec
$ redis-benchmark -n 100000 -c 100 -d 256 -t get,set -q
SET: 121951.22 requests per second
GET: 123001.23 requests per second

Below is a table of the most commonly used options for redis-benchmark.

OptionDescriptionDefault Value
-h Server hostname.127.0.0.1
-p Server port.6379
-a Password for authentication.None
-c Number of parallel connections (clients).50
-n Total number of requests to perform.100000
-d Data size of SET/GET values in bytes.3
-t Comma-separated list of tests to run (e.g., set,get,lpush).All tests
-P Pipeline requests. Use 1 to disable pipelining.1
-k Use persistent connections (1=yes, 0=no).1
-r Use random keys for SET/GET/INCR from a keyspace of size .Not set
-qQuiet mode. Shows only the final queries/sec summary.Disabled
—csvOutput results in CSV format.Disabled
  • DO NOT Run on Production: redis-benchmark can saturate the CPU and network, severely impacting the performance of your live application. Always run it on a dedicated test server with identical hardware and network configuration to production.
  • Simulate Real Workloads: The default benchmark is generic. Use the -t, -d, and -c options to mimic your application’s specific command patterns, data sizes, and concurrency levels for a more accurate assessment.
  • Test Pipelining: Use the -P option to see the significant performance boost from pipelining. For example, -P 16 will send commands in batches of 16.
  • It’s a Baseline: Benchmark results are a baseline, not an absolute guarantee of real-world performance. Application logic, network fluctuations, and other factors will have an impact. Use it to compare configurations, hardware, or Redis versions.