How to Benchmark Redis Performance with redis-benchmark
This guide explains how to use Redis's built‑in redis-benchmark tool to measure the throughput of local or remote Redis instances, covering basic testing, selective command benchmarking, and remote server testing with practical command examples.
redis-benchmark is the built‑in performance testing tool of Redis, used to evaluate the throughput of a local or remote Redis instance.
Basic test
Run the simplest and most comprehensive test with: redis-benchmark -n 100000 -c 100 This command exercises all Redis data‑structure operations, issuing 100 000 requests with 100 concurrent clients, and reports the number of operations per second for each command.
To display only the operations‑per‑second numbers, add the -q flag.
Testing a specific command
For example, to benchmark only SET and LPUSH:
redis-benchmark -t set,lpush -n 100000 -qTesting a remote Redis server
Specify the host and port of the target server:
redis-benchmark -h 127.0.0.1 -p 6379 -c 5000 -n 100000 -qSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
