Skip to content

Add cluster benchmark support to Resp.benchmark - #1906

Merged
Vasileios Zois (vazois) merged 60 commits into
mainfrom
vazois/cluster-bench
Aug 5, 2026
Merged

Vasileios Zois (vazois) merged 60 commits into
mainfrom
vazois/cluster-bench

Conversation

@vazois

Copy link
Copy Markdown
Contributor

Summary

Adds a --cluster-bench mode to Resp.benchmark for benchmarking Garnet cluster deployments.

Features

  • Cluster topology discovery: Automatically discovers shards, slot ranges, and replicas via CLUSTER NODES
  • Two architectures:
    • Sharded mode: Dedicated threads per shard with slot-aware key generation
    • Worker pool mode (--pool): Workers distribute operations across all shards
  • Offline & online modes: Pre-generated RESP buffers (offline) or on-the-fly generation (online)
  • Broadcast mode (--broadcast): Pipeline requests to all shards before completing, maximizing overlap
  • Mixed workload: --replica-ops-percent pipelines writes to primary + reads to replica in parallel
  • Multiple client types: LightClient, GarnetClientSession, GarnetClient, SERedis
  • Operations: GET, SET, MGET, MSET, INCR, DEL
  • Metrics: Kops/sec, data GB/s, wire Gbps, per-shard breakdown, latency percentiles (p50-p99.9), hit rates, primary/replica throughput split

Key files

  • ClusterBench/ClusterWorkloadDriver.cs — Orchestrator (topology, load, config, final reports)
  • ClusterBench/ClientRequestProvider.cs — RESP command generation, routing
  • ClusterBench/ClientRequestProvider.{Offline,Online,WorkerPool}.cs — Mode-specific execution
  • ClusterBench/Worker.cs — Worker thread orchestration
  • ClusterBench/SlotKeyGenerator.cs — Slot-aware key generation with hash-tag prefixes
  • ClusterBench/ClusterManager.cs — Topology discovery and slot mapping

Usage examples

# Basic cluster benchmark (3 shards, 8 threads/shard, offline)
Resp.benchmark --cluster-bench -h 127.0.0.1 -p 7000 --op SET -t 8 --dbsize 65536

# Worker pool with broadcast
Resp.benchmark --cluster-bench -h 127.0.0.1 -p 7000 --op GET -t 16 --dbsize 65536 --pool --broadcast

# Mixed workload with replicas (50% reads to replica)
Resp.benchmark --cluster-bench -h 127.0.0.1 -p 7000 --op SET -t 8 --dbsize 65536 --pool --replica-ops-percent 50

@vazois
Vasileios Zois (vazois) merged commit ca8faef into main Aug 5, 2026
161 checks passed
@vazois
Vasileios Zois (vazois) deleted the vazois/cluster-bench branch August 5, 2026 22:27
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants