Benchmarks & Performance

This chapter presents RedCouch's measured performance characteristics, explains what the numbers mean for your workload, and documents how to reproduce the benchmarks.

How to Read These Numbers

All benchmarks measure end-to-end operation latency — the time from sending a memcached protocol request to receiving the complete response, including network round-trip, protocol parsing, Lua script execution, and response encoding.

  • ops/sec — Operations per second (higher is better)
  • p50 µs — Median latency in microseconds (50th percentile)
  • p95/p99 µs — Tail latency (95th/99th percentile)
  • Errors — Number of failed operations (should be 0)

The benchmark harness uses Python asyncio clients sending individual operations in a tight loop. Throughput numbers reflect single-system capacity, not network-bound scenarios.

Throughput Baselines (Single Client)

Source: benchmarks/results/bench_20260402_144029.json (Redis 8.4.0, macOS arm64, local — no Docker).

Workloadops/secp50 µsp95 µsp99 µsErrors
SET 64B31,6942939770
SET 1KB29,8993141580
SET 64KB8,0741181511810
GET (hit)26,8143545570
GET (miss)36,7822633410
DELETE40,0382431400
INCREMENT31,8833039560
Mixed R/W14,6356580950
APPEND19,4285173860
TOUCH33,8562836500

What this tells you: A single client can sustain ~30k ops/s for SET and ~27k ops/s for GET at sub-100µs p99 latency. GET misses are faster than hits because misses skip the Lua hex-decode step. APPEND is the slowest mutation because it reads, concatenates, and re-encodes the existing value.

Concurrency Scaling (4 Clients)

Workloadops/secp50 µsp95 µs
SET 64B62,57460100
SET 1KB60,43963104
GET (hit)50,92976120
Mixed R/W30,138129184

What this tells you: Throughput roughly doubles from 1 to 4 clients, but latency also increases due to ThreadSafeContext lock contention. The optimal concurrency is ~4 clients; beyond that, the lock becomes the bottleneck and throughput plateaus (see Stress/Soak below).

Cross-System Comparison

To answer "how does RedCouch compare to Couchbase and native Redis?", all three systems were benchmarked under identical conditions using Docker containers with the same resource limits (256 MB maxmemory, no persistence).

Source: benchmarks/results/cross_system_20260403_092550.json (symmetric Docker topology).

Single Client (c=1)

OperationRedCouch ops/sRedis OSS ops/sCouchbase ops/s
SET 64B7,8738,0398,666
GET (hit)6,7768,2948,360
GET (miss)8,2648,2658,249
DELETE8,4218,4028,471

Four Clients (c=4)

OperationRedCouch ops/sRedis OSS ops/sCouchbase ops/s
SET 64B20,71019,23619,757
GET (hit)15,09818,35121,985
GET (miss)21,99219,90322,376
DELETE22,98621,23622,090

Interpretation

  • All three systems are closely matched — at c=1, all systems fall within ±10% of each other for SET, DELETE, and GET miss. The Docker networking layer dominates single-client latency.
  • GET hit is RedCouch's most expensive operation — ~18% slower than Redis native at c=1 due to the Lua hex-decode overhead. This is the cost of binary-safe value storage.
  • RedCouch is a viable bridge — The protocol translation layer does not introduce order-of-magnitude penalties. Migration from memcached protocol to native Redis removes the bridge overhead entirely.

Note: The absolute numbers in the Docker comparison (~8k ops/s at c=1) are lower than the local baselines (~30k ops/s) because Docker networking adds latency. The relative comparisons between systems are what matter.

Stress/Soak Validation

A 7-phase stress suite validated RedCouch's behavior under sustained load:

FindingValueWhat it means
Performance sweet spot4 clients (~61k ops/s SET)Optimal concurrency for throughput
Post-saturation ceiling~35k ops/s at c≥16ThreadSafeContext lock serialization caps throughput
Soak stability175,036 ops / 5s, 0 errorsStable under sustained mixed workload
Memory growth (soak)742 KB over 175k opsNo memory leaks detected
Connection churn169 conn/s, 0 failuresThread-per-connection model handles rapid connect/disconnect

Running Benchmarks

Prerequisites

  • Redis 8+ with RedCouch module loaded (for single-system benchmarks)
  • Python 3.10+ with asyncio support
  • Docker (for cross-system comparison only)

Commands

# Single-system benchmark (requires Redis 8+ with module loaded)
cd benchmarks && bash run_benchmarks.sh

# Stress/soak validation
cd benchmarks && bash run_stress_soak.sh

# Cross-system three-way comparison (requires Docker)
bash benchmarks/run_cross_system.sh

Benchmark artifacts

Results are stored as JSON files in benchmarks/results/. The latest results are symlinked:

SymlinkPoints to
latest.jsonMost recent single-system benchmark
stress_latest.jsonMost recent stress/soak result

Reproducing the cross-system comparison

The cross-system benchmark uses Docker Compose to run all three systems:

# Start all containers (Couchbase, Redis OSS, Redis + RedCouch)
cd benchmarks && docker compose up --build --wait

# Run the benchmark
python3 bench_cross_system.py

# Tear down
docker compose down

See benchmarks/docker-compose.yml for container configuration and benchmarks/Dockerfile.redcouch for the RedCouch container build.