$linuxjunkies
>

redis-benchmark(1)

redis-benchmark is a utility to measure Redis server performance by running load tests with configurable parameters.

UbuntuDebianFedoraArch

Synopsis

redis-benchmark [OPTION]... [COMMAND]...

Description

redis-benchmark is a performance testing tool that connects to a Redis server and executes a series of commands to measure throughput, latency, and overall performance. It's useful for establishing baseline performance metrics, comparing different Redis configurations, and identifying performance bottlenecks.

By default, it tests SET and GET operations, but can be configured to test any Redis command. Results include throughput (requests per second), average latency, percentile latencies (p50, p95, p99), and detailed histograms.

Common options

FlagWhat it does
-hServer hostname (default: 127.0.0.1)
-pServer port (default: 6379)
-cNumber of parallel connections (default: 50)
-nTotal number of requests to execute (default: 100000)
-dData size of SET/GET value in bytes (default: 2)
-tRun only specific comma-separated commands (e.g., set,get,lpush)
-qQuiet mode; show only summary statistics
-lGenerate loop, reconnect N times after disconnect
-aPassword for authentication
--csvOutput results in CSV format
-rSET/GET/INCR key range; keyN from 0 to N-1 (default: 100000)
--latencyEnable latency histogram output

Examples

Run 100,000 requests against localhost Redis server with default SET/GET test

redis-benchmark -h localhost -p 6379 -n 100000

Benchmark with 100 parallel connections, 50k requests, quiet mode showing only summary

redis-benchmark -c 100 -n 50000 -q

Test only SET and GET commands with 1KB values across 10,000 requests

redis-benchmark -d 1024 -n 10000 -t set,get

Benchmark remote Redis server with authentication, output results to CSV file

redis-benchmark -h redis.example.com -a mypassword -n 100000 --csv > results.csv

Test list operations (LPUSH, LPOP) with latency histogram enabled

redis-benchmark -t lpush,lpop -n 50000 --latency

Stress test with 200 connections, 1 million requests, randomized keys from 0-9999

redis-benchmark -c 200 -n 1000000 -r 10000 -q

Display all available command-line options and usage information

redis-benchmark --help

Related commands