tidaldb/docker/stress/Dockerfile
jx12n f640764d89 feat(tidal-stress): open-loop capacity load generator (thepeach feed workload)
New workspace crate: an open-loop, coordinated-omission-corrected HTTP load
generator + capacity ramp for the standalone and multi-process cluster surfaces,
modeling a thepeach feed session (feed reads + view/like/skip signals + search,
signal-dominated per their user-graph spec). Throttleable target rate, ramp
presets (smoke/quick/peach-100k/max) or rps:secs specs, peach/reads/writes/custom
mixes, leader vs sharded write paths, per-op p50/p90/p99/p999/max latency, a
backpressure-aware status breakdown (429/408/503/4xx/5xx/transport), and a verdict
translated to supported DAU. Runs in-cluster as a k8s Job (tidal-stress/k8s/).

Open-loop scheduler (scheduler.rs) fires at a fixed arrival rate and measures
latency from each request's intended send time, so a server stall inflates the
percentiles a closed-loop test hides; it shed-and-counts rather than blocking when
the in-flight cap is reached. Pure-Rust (tokio + reqwest/rustls), no engine deps.

Findings on the live 3-region k3s cluster (docs/ops/stress-test-thepeach.md):
reads scale to thousands/s at <15ms p99; the replicated /signals path saturates at
~90 signals/s (single-leader funnel + 2-worker write pool + synchronous gRPC ship);
the sharded path sustains 3,669 signals/s at 0 errors and ~27% cluster CPU (≈ the
100k-DAU peak, knee not reached). Overload degrades gracefully (429; 0 pod
restarts). thepeach's planned in-process embedding sidesteps all of it (write ≈82ns).
2026-06-10 21:54:21 -06:00

38 lines
1.5 KiB
Docker

# tidal-stress load generator image.
#
# Build context is this repository's root (the workspace Cargo.toml / Cargo.lock
# and every member manifest live there). Build from the repo root:
#
# docker build -f docker/stress/Dockerfile -t tidaldb:stress .
#
# tidal-stress is a pure-Rust HTTP client (tokio + reqwest/rustls): it depends on
# NONE of the engine crates, so this build never compiles tidal/tidal-net/usearch
# and needs no protoc/g++. Pin the builder to bookworm so its glibc matches the
# runtime; trixie's vectorized-math libmvec is handled by the trixie runtime below.
FROM rust:1.91-bookworm AS builder
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /app
# Copy the full (already-pruned by .dockerignore) workspace and build only the
# load generator. The unified workspace requires every member manifest present to
# resolve metadata, so copy the whole context rather than a fragile subset.
COPY . .
RUN cargo build -p tidal-stress --release --locked
FROM debian:trixie-slim
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /srv
# ca-certificates only matters if a target is https:// (in-cluster targets are
# plaintext http://); kept for completeness. No libstdc++ (no C++ in this crate).
RUN useradd --system --home /srv stress && \
apt-get update && apt-get install -y --no-install-recommends ca-certificates && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/tidal-stress /usr/local/bin/tidal-stress
USER stress
# ENTRYPOINT is the bare binary so the Job supplies the full ramp/mix/target argv.
ENTRYPOINT ["tidal-stress"]