# Live performance and regression harness These scripts exercise actual RustProxy executables through loopback sockets. They do not simulate Rust request handling. The Python server in `peer.py` is a controllable test **upstream**, used to verify streaming, non-replayable writes, headers, cache policy and WebSocket frames. Performance measurements use nginx as the shared upstream instead of Python. ## DEV 1 KiB follow-up on 0.34.0 (newer source) See `docs/PROXY_1KB_HOTPATH_DEV_0.34.0.md`. The previous executable's 4-vs-64 idle-connection tuning experiment is real loopback evidence, but the *edited* source has not been compiled. Its new default is 64 for new vhosts, whereas explicitly saved `4` remains `4`. Keep the idle limit equal between before/after *code* benchmarks; measure configuration tuning in a separate labelled series. The source release is not eligible for a claim of 100k RPS or 80% nginx yet. ## Reverse-proxy optimization revision 0.34.0 After compiling the refreshed candidate, measure the same unmodified 0.33.8 binary and nginx reference as before, without turning off logging, request IDs, ACL, cache-policy enforcement or LB health. Profile request-size 1,040 B first. Before RPS runs execute full proxy, LB, transport and concurrency regressions (including single-member capacity, recovery, sticky cookies, replays on safe methods, rejected non-replayable writes and H2 connection shutdown). Treat `--max-idle` tuning and recycles as separately labelled experiments rather than mixing them into the primary comparison. There are no new measured RPS figures in the source candidate. ## Follow-up RPS candidate on 0.34.0 `docs/PROXY_RPS_0.34.0.md` tracks the code changes and their regressions. Compile before/after binaries from the two 0.34.0 source revisions and use the paired benchmark below; a live run against the older binary cannot establish a measured RPS improvement for the uncompiled candidate. Keep `max_idle_per_host`, recycling, HTTP1/H2 settings and all application security and logging features equal between runs. Treat any configuration tuning as a separate experiment. Profile the resulting binary with `perf` only after correctness checks pass. ## Offline cache-retention model for 0.34.0 `python3 scripts/performance/simulate_cache_034.py` compares cache invalidation policies under a deterministic synthetic sequence of vhost saves and uniform cacheable GETs. The model contains **no RustProxy server**, no timing and no network traffic; its percentages are **not measured RPS gains**. See `docs/TEST_REPORT_0.34.0.md` for assumptions and the live acceptance gap. ## Requirements - Linux with readable `/proc`, Python 3.10+, executable RustProxy binaries. - nginx and wrk for performance comparisons. Both paths are explicit; no system-wide installation is required. - `taskset` from util-linux for the benchmark's explicit CPU affinity and for optional affinity settings in the other scripts. - Optional Python `brotli` and `zstandard` decoders increase compression acceptance coverage. A missing optional decoder is reported as **skipped**. - Permission to bind unprivileged loopback sockets and start local processes. In a sandbox without sockets or `/proc`, run in the approved local execution environment. Do not replace real runtime results with a peer self-test. Each run creates a new private temporary data directory and initializes its own administrator with a random password supplied only over stdin. Configurations are applied through RustProxy's existing authenticated CLI/API and listener changes receive a restart. No historical SQLite database is copied or edited. TLS keys, databases and passwords are never written to the evidence directory. Temporary state is outside the evidence tree and is removed on normal exit. `fixture-cleanup.json` records the cleanup check. Interrupted runs can leave an unrelated `/tmp/rustproxy-perf-*` directory; do not include it in a release. Before timed benchmark, soak or syscall-profile work, `wait_quiescent()` waits for the existing authenticated ACME runtime API to report `ready` or `unavailable`. A fresh RustProxy data directory can start a Python/Certbot environment bootstrap even when no certificates have an issuer. The gate requires no configured issuers, jobs or renewal observations, the same live Rust PID and start time, and no child processes for five continuous seconds. It polls every 0.5 seconds and fails after 180 seconds instead of measuring installation work. Selected status, process count and timing evidence is saved in `