Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .github/workflows/soak-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Soak bench (D1/D2)

# RFC 0009 D1/D2 sustained-ingest soak (`ourios-bench soak`,
# `docs/benchmarks.md` §D1/§D2): the real ingest path in-process — OTLP →
# group-commit WAL fsync (100 ms window) → miner → Parquet sink — at a
# paced rate, with compaction sweeps driven on a synthetic (compressed)
# clock so the seal→sweep→compact cycle runs without waiting real hours.
# `workflow_dispatch`-only: an hour-long paced load is far too heavy for
# the per-PR loop, and the ci-runner wall-clock is indicative,
# non-authoritative — the §1 baseline (`baseline-8vcpu-32gib`) carries
# the authoritative D1/D2 numbers.

on:
workflow_dispatch:
inputs:
duration_seconds:
description: "Load duration in wall seconds"
required: false
default: "3600"
rate_lines_per_sec:
description: "Target ingest rate (lines/s, whole process)"
required: false
default: "100000"
time_compression:
description: "Synthetic seconds per wall second (60 = one wall-minute per synthetic hour)"
required: false
default: "60"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
soak-bench:
name: D1/D2 sustained-ingest soak
runs-on: ubuntu-latest
# The load duration plus build time; a dispatch asking for the full
# hour still finishes with room to spare.
timeout-minutes: 120
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master (pinned); channel via toolchain input
with:
toolchain: stable
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2

- name: Build ourios-bench (release)
run: cargo build -p ourios-bench --release --bin ourios-bench

- name: Run D1/D2 soak
env:
DURATION_SECONDS: ${{ inputs.duration_seconds }}
RATE_LINES_PER_SEC: ${{ inputs.rate_lines_per_sec }}
TIME_COMPRESSION: ${{ inputs.time_compression }}
run: |
set -euo pipefail
target/release/ourios-bench soak \
--duration-secs "$DURATION_SECONDS" \
--target-lines-per-sec "$RATE_LINES_PER_SEC" \
--time-compression "$TIME_COMPRESSION" \
--out soak-report.json 2>&1 | tee soak-bench.log

- name: Write job summary (D1/D2)
if: always()
run: |
{
echo '## ourios soak bench — D1/D2'
echo
echo '**Hardware: `ci-runner` (indicative — non-authoritative pending `baseline-8vcpu-32gib`).**'
echo
if [ -f soak-report.json ]; then
echo '| gate | measured | bar | verdict |'
echo '| --- | --- | --- | --- |'
jq -r '
def verdict: if . then "PASS" else "FAIL" end;
"| D1 throughput | \(.per_core_lines_per_sec | round) lines/s/core (\(.achieved_lines_per_sec | round) total / \(.config.worker_threads) workers) | ≥ \(.d1.bar_lines_per_sec_per_core) lines/s/core | \(.d1.pass | verdict) |",
"| D1 ack latency | p99 \(.d1.p99_ack_ms) ms (p50 \(.latency.p50_ms) / max \(.latency.max_ms)) | p99 ≤ \(.d1.bar_p99_ack_ms) ms | \(.d1.pass | verdict) |",
"| D2 backlog | max \(.d2.max_backlog_partitions) partition(s), final \(.d2.final_backlog_partitions), returned to zero: \(.d2.returned_to_zero_after_max) | bounded, drains to 0 | \(.d2.pass | verdict) |"
' soak-report.json
echo
echo 'Run shape:'
echo '```'
jq -r '"wall \(.load_wall_secs)s load / \(.total_wall_secs)s total · \(.lines_acked) lines acked (\(.batches_acked) batches, \(.batches_failed) failed) · \(.total_partitions_compacted) partitions compacted over \(.samples | length) samples · latency basis \(.latency_samples_stored)/\(.latency_samples_total) samples"' soak-report.json
echo '```'
else
echo '_No soak-report.json — the run failed before producing it._'
fi
echo
echo '> **Indicative only.** A hosted runner is not the `docs/benchmarks.md` §1'
echo '> baseline; the authoritative D1/D2 numbers come from `baseline-8vcpu-32gib`.'
echo '> The synthetic clock compresses record time so the seal→sweep→compact'
echo '> path runs for real; D1 throughput/latency are measured in wall-clock.'
echo '> Runs the maintainer selects are recorded by hand in docs/benchmarks.md §9.'
} >> "$GITHUB_STEP_SUMMARY"

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
with:
name: soak-bench
path: |
soak-report.json
soak-bench.log
if-no-files-found: warn
24 changes: 14 additions & 10 deletions crates/ourios-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,20 @@ tempfile = "3"
# dev-only while the only in-process queries lived in the B2 criterion
# bench, which still uses them via these regular deps.)
ourios-querier = { path = "../ourios-querier" }
tokio = { version = "=1.52.3", default-features = false, features = ["rt"] }
# The RFC 0009 D1/D2 soak harness (`soak`) needs the multi-thread
# runtime: the group-commit coordinator offloads its fsync via
# `spawn_blocking`, which a current-thread runtime would serialize
# behind the load loop. `time` paces the load, `sync` bounds in-flight
# batches (Semaphore) + carries the sampler stop signal (watch), and
# `macros` gives the sampler's tick-vs-stop `select!`.
tokio = { version = "=1.52.3", default-features = false, features = ["rt", "rt-multi-thread", "time", "sync", "macros"] }
# The soak harness drives the real ingest path in-process: WAL →
# group-commit coordinator → `IngestPipeline` → record sink, with the
# compactor's `run_sweep` driven manually on the synthetic cadence.
# Regular (not dev) deps since the `soak` subcommand ships in the bin;
# the criterion benches use them through these same lines.
ourios-wal = { path = "../ourios-wal" }
ourios-ingester = { path = "../ourios-ingester" }
# RFC 0031 L4 (frequency-aggregation) pair: decodes the querier's RFC 3339
# `bucket(width)` group-key rendering back to Unix nanoseconds for the
# `AggKey` comparison against Loki. Same version `ourios-querier` pins.
Expand Down Expand Up @@ -109,15 +122,6 @@ proptest = "=1.11.0"
# which is what B2's "median latency" target wants; ourios-querier (a
# regular dependency above) is the unit under test.
criterion = "=0.8.2"
# RFC0008.3 recovery-non-amplification bench: times `Wal::replay`
# over N ∈ {1, 4, 16} segments. Supportive wall-clock evidence
# (the O(N) shape) mirroring b1/b2's role; the structural side is
# pinned by `ourios-wal`'s `rfc0008_3_*` integration tests.
ourios-wal = { path = "../ourios-wal" }
# Ingest write-path bench (CLAUDE.md §6.2 hot paths): drives the RFC 0014
# `ParquetRecordSink` for the WAL → Parquet half; the WAL half uses
# `ourios-wal` directly.
ourios-ingester = { path = "../ourios-ingester" }

[[bench]]
name = "b1"
Expand Down
8 changes: 7 additions & 1 deletion crates/ourios-bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
//! `calibrate` + `reference` + `store` (RFC 0024 / the B1/B2 query
//! stores), and the RFC 0031 comparative harness (`comparative` — the
//! Loki equivalence check + measurement channel — and `lgates`, the
//! comparative must-win / floor gate math).
//! comparative must-win / floor gate math), plus the RFC 0009 D1/D2
//! sustained-ingest soak harness (`soak`).

#![deny(unsafe_code)]

Expand All @@ -44,6 +45,7 @@ mod harness;
mod lgates;
mod reference;
mod report;
mod soak;
mod store;

pub use calibrate::{CALIBRATION_DIR, extract_manifest, write_manifest};
Expand All @@ -61,6 +63,10 @@ pub use lgates::{
};
pub use reference::ReferenceCorpus;
pub use report::{update_status_section, write_results_json};
pub use soak::{
BacklogSample, D1Verdict, D2Verdict, LatencySummary, SoakConfig, SoakError, SoakReport,
default_worker_threads, run_soak,
};
pub use store::{B1Store, BuiltStore, build_b1_store, build_comparative_store, build_query_store};

/// Configuration for one bench invocation.
Expand Down
Loading