Skip to content

feat: add memtier_benchmark support and dragonfly benchmarks - #66

Merged
kacy merged 12 commits into
mainfrom
feat/memtier-benchmarks
Feb 8, 2026
Merged

feat: add memtier_benchmark support and dragonfly benchmarks#66
kacy merged 12 commits into
mainfrom
feat/memtier-benchmarks

Conversation

@kacy

@kacy kacy commented Feb 8, 2026

Copy link
Copy Markdown
Owner

summary

  • adds bench/bench-memtier.sh for comprehensive benchmarking with memtier_benchmark alongside the existing redis-benchmark suite
  • fixes dragonfly binary detection in setup-vm.sh (archive contains dragonfly-x86_64, not dragonfly)
  • updates bench README with results from both benchmark tools, including dragonfly numbers

key design decisions

  • one server at a time: memtier's higher thread count causes CPU contention when multiple servers run simultaneously on the same machine. the script starts, benchmarks, and stops each server individually for reliable results.
  • retry on zero ops: memtier occasionally produces 0 ops/sec on first attempt (no clear upstream fix). the script retries once with a 2-second delay, which eliminates the issue.
  • health check between tests: verifies the server is still responding between benchmark runs to detect crashes early.

results (GCP c2-standard-8, 8 vCPU)

ember concurrent vs redis/dragonfly (64B values, pipeline=16):

benchmark tool vs redis SET vs redis GET vs dragonfly SET vs dragonfly GET
redis-benchmark 1.9x 2.2x 2.0x 2.7x
memtier 1.6x 1.6x 1.8x 2.0x

what was tested

  • ran full redis-benchmark and memtier suites on fresh GCP c2-standard-8 VM
  • verified dragonfly installation works with updated setup-vm.sh
  • confirmed zero-free results with retry logic across multiple runs

kacy added 12 commits February 8, 2026 16:11
add bench-memtier.sh for comprehensive benchmarking using
memtier_benchmark, which provides better latency distributions and
mixed workload testing (SET:GET ratios) compared to redis-benchmark.

test matrix includes SET-only, GET-only, mixed 1:10 (read-heavy cache),
mixed 1:1 (session store), large values, and no-pipeline latency tests
across ember concurrent, ember sharded, redis, and dragonfly.

update setup-vm.sh to install memtier_benchmark (build from source) and
dragonfly (binary download) on GCP VMs alongside the existing redis and
rust toolchain setup.
memtier runs can occasionally produce empty output when rapidly
switching between servers under heavy load. add a single retry if the
Totals line is missing, and a brief 0.5s settling pause between runs
to reduce resource contention.
restructure the benchmark loop to complete all tests for one server
before moving to the next, rather than interleaving tests across
servers. this eliminates CPU contention on shared-machine benchmarks
where multiple servers compete for cores.
memtier's output can contain bytes that truncate bash strings when
captured in a variable. pipe stdout directly to awk for extraction
instead of intermediate variable capture.
write memtier output to a temp file instead of piping or capturing in
a variable. adds a warning to stderr when no Totals line is found,
making failures visible for diagnosis.
pass the detected CPU core count via --shards instead of relying on
the default auto-detection. makes the benchmark configuration explicit
and visible in the output.
concurrent mode uses DashMap directly and doesn't benefit from
the --shards flag. the flag still creates a full sharded engine
with idle worker threads that may contend for CPU cores.
redis-benchmark --threads adds coordination overhead that reduces
measured throughput on most systems. single-threaded mode gives more
accurate and reproducible results.

also bumps default requests from 100k to 500k for more stable
measurements — 100k finishes too quickly to warm up properly.
the apparent regression was caused by a degraded GCP VM, not
benchmark methodology. a fresh c2-standard-8 instance reproduces
the README numbers exactly with the original settings (100k requests,
--threads=CPU cores).

reverts: d2cd1d9, 65e11c3, 0f01eaa
the dragonfly release archive contains the binary as
dragonfly-x86_64, not dragonfly. updated the find pattern
to match the actual filename.
running all servers simultaneously caused CPU contention that
produced sporadic 0 ops/sec results. restructured to start,
benchmark, and stop each server individually. also added:

- retry on 0 ops (memtier occasionally fails on first attempt)
- health check between tests to detect server crashes
- settling delay between tests for connection draining
tested on GCP c2-standard-8 with dragonfly v1.36.0.
ember concurrent achieves 2.0-2.7x throughput vs dragonfly
on pipelined GET/SET. dragonfly has notably higher p99
latency (~1ms vs ~0.4ms) on this single-machine setup.
@kacy
kacy merged commit a588cc0 into main Feb 8, 2026
5 checks passed
@kacy
kacy deleted the feat/memtier-benchmarks branch February 8, 2026 22:57
kacy added a commit that referenced this pull request Feb 11, 2026
* feat: add memtier_benchmark support to benchmarking suite

add bench-memtier.sh for comprehensive benchmarking using
memtier_benchmark, which provides better latency distributions and
mixed workload testing (SET:GET ratios) compared to redis-benchmark.

test matrix includes SET-only, GET-only, mixed 1:10 (read-heavy cache),
mixed 1:1 (session store), large values, and no-pipeline latency tests
across ember concurrent, ember sharded, redis, and dragonfly.

update setup-vm.sh to install memtier_benchmark (build from source) and
dragonfly (binary download) on GCP VMs alongside the existing redis and
rust toolchain setup.

* fix: add retry logic and settling delay to memtier benchmark

memtier runs can occasionally produce empty output when rapidly
switching between servers under heavy load. add a single retry if the
Totals line is missing, and a brief 0.5s settling pause between runs
to reduce resource contention.

* fix: run all tests per server to avoid cross-server contention

restructure the benchmark loop to complete all tests for one server
before moving to the next, rather than interleaving tests across
servers. this eliminates CPU contention on shared-machine benchmarks
where multiple servers compete for cores.

* fix: pipe memtier output directly through awk

memtier's output can contain bytes that truncate bash strings when
captured in a variable. pipe stdout directly to awk for extraction
instead of intermediate variable capture.

* fix: use temp file for memtier output parsing

write memtier output to a temp file instead of piping or capturing in
a variable. adds a warning to stderr when no Totals line is found,
making failures visible for diagnosis.

* fix: explicitly pass --shards to ember-server in all bench scripts

pass the detected CPU core count via --shards instead of relying on
the default auto-detection. makes the benchmark configuration explicit
and visible in the output.

* fix: remove --shards from concurrent mode bench launches

concurrent mode uses DashMap directly and doesn't benefit from
the --shards flag. the flag still creates a full sharded engine
with idle worker threads that may contend for CPU cores.

* fix: remove multi-threaded redis-benchmark, increase default requests

redis-benchmark --threads adds coordination overhead that reduces
measured throughput on most systems. single-threaded mode gives more
accurate and reproducible results.

also bumps default requests from 100k to 500k for more stable
measurements — 100k finishes too quickly to warm up properly.

* revert: restore original benchmark defaults

the apparent regression was caused by a degraded GCP VM, not
benchmark methodology. a fresh c2-standard-8 instance reproduces
the README numbers exactly with the original settings (100k requests,
--threads=CPU cores).

reverts: d2cd1d9, 65e11c3, 0f01eaa

* fix: match dragonfly binary name in setup-vm.sh

the dragonfly release archive contains the binary as
dragonfly-x86_64, not dragonfly. updated the find pattern
to match the actual filename.

* fix: run memtier tests one server at a time with retry logic

running all servers simultaneously caused CPU contention that
produced sporadic 0 ops/sec results. restructured to start,
benchmark, and stop each server individually. also added:

- retry on 0 ops (memtier occasionally fails on first attempt)
- health check between tests to detect server crashes
- settling delay between tests for connection draining

* docs: add dragonfly benchmark numbers to README

tested on GCP c2-standard-8 with dragonfly v1.36.0.
ember concurrent achieves 2.0-2.7x throughput vs dragonfly
on pipelined GET/SET. dragonfly has notably higher p99
latency (~1ms vs ~0.4ms) on this single-machine setup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant