LinuxCommandLibrary

redis-benchmark

TLDR

Run default benchmark

$ redis-benchmark
copy
Connect to host
$ redis-benchmark -h [localhost] -p [6379]
copy
Set client count
$ redis-benchmark -c [100]
copy
Set request count
$ redis-benchmark -n [10000]
copy
Test specific command
$ redis-benchmark -t [get,set]
copy
Test with specific data size
$ redis-benchmark -d [256]
copy
Pipeline requests
$ redis-benchmark -P [16]
copy
Quiet mode
$ redis-benchmark -q
copy

SYNOPSIS

redis-benchmark [-h host] [-p port] [-c clients] [-n requests] [options]

DESCRIPTION

redis-benchmark measures Redis server performance. It simulates clients running various commands.
Multiple commands are tested by default. SET, GET, INCR, LPUSH, and others.
Concurrency tests parallel connections. Higher client counts stress the server more.
Pipelining batches requests. This tests throughput without network round-trip latency.
Data size affects memory and network. Larger payloads test different bottlenecks.

PARAMETERS

-h HOST

Server hostname.
-p PORT
Server port.
-c N
Concurrent clients.
-n N
Total requests.
-t TESTS
Test commands.
-d SIZE
Data size in bytes.
-P N
Pipeline N requests.
-q
Quiet, show query/sec.
-a PASSWORD
Authentication password.
--csv
CSV output.

CAVEATS

Results vary by hardware and network. Local testing eliminates network overhead. Production has different patterns.

HISTORY

redis-benchmark is included with Redis, originally created by Salvatore Sanfilippo in 2009. It provides standardized performance testing for Redis deployments.

SEE ALSO

Copied to clipboard