redis/bcast-tracking-bench

Verified Publisher

By Redis

Updated about 1 month ago

Redis CLIENT TRACKING BCAST invalidation listener for benchmarking many concurrent listeners

Image
0

625

redis/bcast-tracking-bench repository overview

bcast-listener

A Redis client-side caching (CLIENT TRACKING ... BCAST) listener helper. It spins up a configurable number of fred clients, enables RESP3 broadcast invalidation tracking on each, and drains the resulting invalidation messages. It is intended for benchmarking and ad-hoc testing of Redis broadcast tracking under many concurrent listeners.

Requirements

  • A recent stable Rust toolchain (edition 2024, so Rust 1.85+).
  • A reachable Redis server with RESP3 / client tracking support (Redis 6+).

Build

# Debug build
cargo build

# Optimized release build (recommended for benchmarking)
cargo build --release

The resulting binary is written to target/debug/bcast-listener or target/release/bcast-listener.

Run

The tool has two modes.

Manual mode

Spins up the listeners directly from CLI flags, then waits for Ctrl-C before shutting down. Useful for quick, interactive testing.

cargo run --release -- manual \
  --redis-url redis://127.0.0.1:6379/0 \
  --listener-count 100 \
  --tracking-prefix bench:

Options:

FlagDescription
--redis-url <url>Redis connection URL (required)
--listener-count <n>Number of tracking clients to create (required)
--tracking-prefix <prefix>Key prefix to track (default: bench:)
-h, --helpPrint usage

Note: The helper currently tracks all keys in BCAST mode, so --tracking-prefix is accepted for CLI compatibility but does not filter invalidations.

Stdin/stdout mode (default)

When no manual subcommand is given, the tool reads one line-delimited JSON command per line from stdin and writes one JSON response per line to stdout. This is intended to be driven by another process (e.g. a benchmark harness).

cargo run --release

Then send commands on stdin, one JSON object per line:

{"command":"setup","redis_url":"redis://127.0.0.1:6379/0","listener_count":100,"tracking_prefix":"bench:"}
{"command":"start_round","round_id":"r1","round_prefix":"bench:r1:","expected_keys":100}
{"command":"shutdown"}

Each command produces a JSON response, for example:

{"status":"ok","listener_count":100,"startup_duration_ms":42.5}

Help

cargo run -- --help

Tag summary

Content type

Image

Digest

sha256:3de4cee61

Size

5.5 MB

Last updated

about 1 month ago

docker pull redis/bcast-tracking-bench

This week's pulls

Pulls:

92

Last week