Benchmarking

Benchmarking #

This page describes how to measure the engine. It deliberately contains no performance numbers: a number without the commit, hardware, backend and flags that produced it is noise.

Load generators that work #

redis-benchmark and memtier_benchmark both work, because the wire protocol is RESP.

# baseline: one connection per request, no pipeline
redis-benchmark -h 127.0.0.1 -p 11001 -t set,get -n 200000 -c 50

# pipelined
redis-benchmark -h 127.0.0.1 -p 11001 -t set,get -n 1000000 -c 50 -P 16

# mixed, with memtier
memtier_benchmark -s 127.0.0.1 -p 11001 --protocol=redis \
  --clients=50 --threads=4 --ratio=1:1 --test-time=120 --key-pattern=S:S

What they will not exercise:

Not coveredWhy
SCAN/XSCAN paginationNo built-in workload; drive it from a script
Cluster redirectsBenchmark against the leader, or expect -MOVED in the error count
TTL expiry pressureAdd EX to the SET payload and watch INFO Store
Raft apply latencyThe write is acknowledged after quorum; add nodes to see the delta

What to hold constant #

Record all of these with any result, or the number is not comparable:

  1. Commit — git rev-parse HEAD, and the BuildVersion from -h.
  2. Backend — --storage-backend, and for badger/hybriddb the host’s RAM (the drivers open with 1 GB memtable/large caches by default).
  3. Durability — --nosync on or off. This is usually the single largest factor on writes.
  4. Cluster size and read mode — 1 node vs 3 nodes; --openreads vs leader-only.
  5. Client side — connection count, pipeline depth, value size, and whether the client is on the same host (loopback hides the network).

Workloads worth running #

WorkloadCommand shapeWhat it tells you
Point writeSET key <256B>Raft + storage write path
Point readGET keyCache + storage read path
CounterINCR hitsRead-modify-write inside the apply loop
Hash writeHSET k f vMulti-record encoding cost
List push/popRPUSH q v / LPOP qIndex encoding, meta updates
ZSet writeZADD board <score> mTwo indexes per member
Range readZRANGE board 0 100 WITHSCORESIndex scan efficiency
Fat valueSET k <64KiB>Allocation, reply size, GC pressure

Reading the server side while you load it #

watch -n1 'redis-cli -p 11001 INFO | sed -n "/# Store/,/# Mem/p"'
curl -s http://127.0.0.1:11002/metrics | grep icefiredb_connected_clients

INFO gives per-process counters (get, get_missing, put, batch_commit, and their total times), which is usually more informative than the load generator’s own percentiles: a rising batch_commit_total_time with flat throughput means the storage device, not the engine, is the limit.

Anti-patterns #

  • Benchmarking a follower without --openreads. Every read becomes a redirect and the number measures your client’s retry loop.
  • Comparing --nosync runs against durable ones. Different guarantees; report both or neither.
  • Using LINSERT/LREM in a throughput test. They rebuild the whole list; they measure O(n) rewrites, not list performance.
  • Ignoring the apply loop. Throughput is bounded by one apply goroutine, so more client threads stop helping at some point; find that point instead of assuming it away.
  • Quoting numbers from this page. There are none, on purpose.