Another Redis Benchmark is a Go-based application designed for performance testing of Redis instances. It simulates real-world client workloads to measure operations latency and throughput for SET, GET, and DEL commands.
- Simulates realistic Redis workloads with multiple concurrent clients.
- Measures latency for
SET,GET, andDELoperations. - Supports configurable test parameters (e.g., number of clients, key count, test duration).
- Provides detailed statistics, including:
- Total operations.
- Average operations per second.
- Minimum, average, and maximum latency for each operation.
- Cross-platform support (Linux, MacOS, Windows, ARM64, and AMD64).
- Redis: Ensure you have a Redis instance running and accessible.
- Go: Version 1.23 or higher.
- Clone the repository:
git clone https://github.com/<your-repo>/another-redis-benchmark.git cd another-redis-benchmark
- Build the binary:
go build -o another-redis-benchmark
You can download prebuilt binaries for your platform from the Releases page.
Run the application with customizable parameters.
./another-redis-benchmark [options]| Option | Default Value | Description |
|---|---|---|
-addr |
localhost:6379 |
Redis server address. |
-pass |
"" |
Redis server password. |
-db |
0 |
Redis database index. |
-clients |
10 |
Number of concurrent clients to simulate. |
-keys |
1000 |
Number of unique keys to test. |
-prefix |
benchmark_ |
Prefix for generated keys. |
-ttl |
60s |
Time-to-live for SET operations. |
-duration |
10s |
Test duration. |
-set |
0.5 |
Proportion of SET operations (relative to the total workload). |
-get |
0.4 |
Proportion of GET operations (relative to the total workload). |
-del |
0.1 |
Proportion of DEL operations (relative to the total workload). |
./another-redis-benchmark./another-redis-benchmark -addr "redis.example.com:6379" -pass "my_redis_password"./another-redis-benchmark -clients 50 -keys 10000 -duration 30sClient 1: SET=123, GET=456, DEL=78
Client 2: SET=234, GET=567, DEL=89
...
Total: SET=357, GET=1023, DEL=167
Benchmark complete.
Total clients: 10
Total keys: 1000
Total time: 10s
SET operations: 5000
GET operations: 4000
DEL operations: 1000
Average SET ops/sec: 500.0
Average GET ops/sec: 400.0
Average DEL ops/sec: 100.0
SET Latency (ms): Min=0.50, Avg=1.23, Max=10.45
GET Latency (ms): Min=0.45, Avg=1.10, Max=8.97
DEL Latency (ms): Min=0.60, Avg=1.45, Max=12.34
- Use the
-keysparameter to define the number of unique keys. - Higher values spread operations across more keys, reducing key collisions.
- Adjust
-set,-get, and-delratios to simulate specific workloads. - Example:
-set 0.7 -get 0.2 -del 0.1focuses onSEToperations.
Download the appropriate binary for your platform:
- Linux:
another-redis-benchmark-linux-amd64.zip - MacOS:
another-redis-benchmark-darwin-arm64.zip - Windows:
another-redis-benchmark-windows-amd64.zip
Extract the ZIP file and run the executable.
To test the application:
go test ./...Feel free to open issues or submit pull requests. Follow the CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License. See LICENSE for details.
- High Latency on Large Key Sets:
- Ensure Redis server is properly configured for high throughput.
- Limited Resources on Local Machines:
- Consider testing on a dedicated Redis server for accurate benchmarks.