Garnet Benchmark Scripts Based on Official Documentation
Based on the Garnet benchmarking results page, I'll create a series of benchmark scripts that match the tests shown in the documentation. Since you already have .NET and Garnet Docker container running, these scripts will focus solely on executing the benchmark tests.
1. Basic Throughput Benchmark (basic_throughput.sh)
This matches the primary benchmark shown in the documentation:
#!/bin/bash
# basic_throughput.sh - Basic throughput test matching the documentation
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
--client-stats \
--latency-history
2. Variable Payload Size Benchmark (variable_payload.sh)
#!/bin/bash
# variable_payload.sh - Tests with different payload sizes
echo "=== Testing with 16B payload ==="
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
-d 16
echo -e "\n=== Testing with 64B payload ==="
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
-d 64
echo -e "\n=== Testing with 256B payload ==="
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
-d 256
3. Pipeline Benchmark (pipeline.sh)
#!/bin/bash
# pipeline.sh - Pipeline performance test
for pipeline in 1 5 10 20; do
echo -e "\n=== Testing with pipeline=$pipeline ==="
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
--pipeline $pipeline
done
4. Mixed Workload Benchmark (mixed_workload.sh)
#!/bin/bash
# mixed_workload.sh - Mixed GET/SET workload test
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
--ratio 1:1 \
--client-stats
5. Latency Distribution Test (latency_distribution.sh)
#!/bin/bash
# latency_distribution.sh - Detailed latency analysis
RESP.bench -h 127.0.0.1 -p 6379 \
-n 1000000 \
-c 100 \
--latency-history \
--latency-dist
6. Comprehensive Benchmark Suite (full_benchmark.sh)
#!/bin/bash
# full_benchmark.sh - Runs all benchmark tests sequentially
echo "=== Starting Comprehensive Garnet Benchmark ==="
echo "Current time: $(date)"
echo "Garnet version: $(docker exec garnet-benchmark cat /garnet/VERSION)"
echo -e "\n=== 1. Basic Throughput Test ==="
./basic_throughput.sh
echo -e "\n=== 2. Variable Payload Test ==="
./variable_payload.sh
echo -e "\n=== 3. Pipeline Performance Test ==="
./pipeline.sh
echo -e "\n=== 4. Mixed Workload Test ==="
./mixed_workload.sh
echo -e "\n=== 5. Latency Distribution Test ==="
./latency_distribution.sh
echo -e "\n=== Benchmark Complete ==="
echo "End time: $(date)"