Skip to content

CIP-5493: idle RSS growth rig for released Proxy images - #512

Open
tobyhede wants to merge 3 commits into
mainfrom
toby/cip-5493-rss-soak-rig-measures-the-stock-proxy-225
Open

tobyhede wants to merge 3 commits into
mainfrom
toby/cip-5493-rss-soak-rig-measures-the-stock-proxy-225

Conversation

@tobyhede

Copy link
Copy Markdown
Contributor

Summary

Adds an rss-idle subcommand to the burn-in package for CIP-5493.
It measures how fast the RSS of a released Proxy image grows with zero client connections, without building or changing Proxy.

mise run burn-in:rss-idle
  for each reload interval (60s, 1s), concurrently
    generate throwaway CA + server certificate
    start postgres:17            # hostssl only, log_connections=on
    start cipherstash/proxy:2.2.5  # unmodified, --memory 512m
      entrypoint trusts the CA, installs bundled EQL + example schema
      CS_DATABASE__WITH_TLS_VERIFICATION=true
    every 10s: docker exec cat /proc/1/smaps_rollup -> rss, anonymous
    count TLS connections from the PostgreSQL log
  least-squares fit after warm-up
  write target/burn-in/rss-idle-report.json
 packages/cipherstash-proxy-burn-in/src/
+├── image_rig.rs   # container orchestration, sampling, report
+├── slope.rs       # least-squares fit with R²
 ├── main.rs        # + rss-idle subcommand
 └── soak.rs        # report helpers made pub(crate)

Evidence

  • Before: no way to measure a released image; soak always builds Proxy from the current source and samples VmRSS only.
    After: a two-hour run of cipherstash/proxy@sha256:e777722f23e1421eeb10cc513ec0871e1407ae8c0b73aaf81ab3d5a18ba333a1 (cipherstash-proxy 2.2.5, linux/arm64):
Run TLS connections in fit window RSS, 2 min → 2 h Fitted slope R² Second hour only
60s reloads 236 14.94 → 16.78 MiB 11,830 bytes/reload, 16.2 MiB/day 0.81 3.1 MiB/day
1s reloads 14,160 16.04 → 17.02 MiB 32 bytes/reload, 0.04 MiB/day at 60s reloads 0.32 0.5 MiB/day

Idle is flat, so it does not reproduce the reported 57–63 MiB/day.
The 16.2 MiB/day on the 60s run is startup settling in the first 50 minutes; the default 120s warm-up is too short for that cadence.
The full reading is on CIP-5493.

  • TLS verification is active: the same image without the rig CA exits with invalid peer certificate: UnknownIssuer.
  • cargo test -p cipherstash-proxy-burn-in: 17 passed.
  • cargo clippy -p cipherstash-proxy-burn-in --all-targets -- -D warnings and cargo fmt --all -- --check: clean.

Merge Danger

Door: two-way

Test tooling only.
No Proxy source changes and nothing runs in CI yet; the CI slope gate is CIP-5499.

Blast Radius: burn-in

write_report_atomic, preflight_output and workspace_root in soak.rs became pub(crate), with no behaviour change to the existing soak.

@coderdan coderdan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Add an rss-idle subcommand that runs a released Proxy image unmodified
against TLS-only PostgreSQL with certificate verification, samples
smaps_rollup, and reports the fitted growth slope per reload and per day.

CIP-5493
Idle RSS of the released image did not reproduce the reported growth, so
the rig needs to vary what else is periodic. Add a scraper container for
Proxy's Prometheus exporter with growth reported per scrape, a run name
so variants can execute side by side, a second-half slope that is not
inflated by startup settling, and a reloads-disabled control.

Stop setting the Docker working directory to the build machine's
workspace path, so a cross-compiled rig binary runs on another host.
Emulated amd64 measures the emulator's memory, not Proxy's.

CIP-5495
The rig could only measure Proxy with nothing connected, and no idle
variant of stock 2.2.5 reproduced the 57-63 MiB/day growth customers
report. Reproducing it needs client activity.

Add five workloads the rig process drives through a published loopback
port: tcp-probe, startup-probe, login-churn, idle-pool and
pooled-queries. The report gains a client section and growth per client
operation, with a projection at a stated production rate.

With these, a pool of idle connections reproduces the growth on stock
2.2.5: Proxy closes each idle connection at connection_timeout, the
pool reconnects, and the old connection is never released (CIP-5495).

Document how to measure a patched binary against a release by swapping
only the binary in the released image.
@tobyhede
tobyhede force-pushed the toby/cip-5493-rss-soak-rig-measures-the-stock-proxy-225 branch from 4407f3f to d29d839 Compare November 23, 2026 02:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants