Skip to content

3.x.x: model rental churn in the load harness: bursts, abrupt departures, reconnect storms, and a rental-churn nightly preset (#521) - #539

Merged
djh58 merged 1 commit into
3.x.xfrom
djh58/prism-b521-churn
Sep 28, 2026
Merged

djh58 merged 1 commit into
3.x.xfrom
djh58/prism-b521-churn

Conversation

@djh58

@djh58 djh58 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Refs #521 (Dan's connection-churn requirement for the nightly load harness, on top of #536).

Why

Production does not hold a fixed set of sessions. Hash rental arrives as a burst of sessions that connect within seconds, mines for a heavy-tailed lifetime, and leaves by dropping its sockets. A rental failing over between pools drops and reconnects many sessions at once. Mainnet does not record connection velocity (there is no session table, and connects are not logged), so this is a seeded parameter sweep. Every parameter is a flag, every flag defaults to off, and a preset pins them all.

What

--churn-seconds adds a side phase, churn: after slow_database, or after warm-up under --plan tips. It runs with no proxy delay and outside the capacity artifact. Its plan is generated once from --seed:

Model Flags
Rental bursts: K sessions connecting within a window, mining for the heaviest address at --rental-hashrate times a mean session (vardiff difficulty accordingly) --rental-bursts (a list such as 100,500,2000, or pareto:/lognormal: draws ;count=n), --rental-burst-window-seconds, --rental-burst-interval-seconds, --rental-hashrate
Heavy-tailed lifetimes, then an abrupt close: no quiesce, outstanding submits recorded as abandoned (churn close) --rental-lifetime
Reconnect storms: a seeded fraction of the connected sessions, base and rental, dropped abruptly and reconnected after a seeded delay --reconnect-storms, --storm-interval-seconds, --storm-reconnect-seconds
Tips minted through the phase --churn-tips, --churn-rate
  • A share the server committed after its session left is reported under no_response_commits with churn_closed: true. It is never counted as an ACK/commit divergence.
  • The frontends' connection cap and the file-descriptor limit are sized for --sessions plus every rental the bursts could connect.

Report. A new churn block holds:

  • the parameters and the plan;
  • the realised churn: rentals spawned and departed, abrupt closes, each storm's connected and dropped counts, completed reconnects, and connects per second and concurrent sessions per second with their extremes;
  • time_to_first_job for new connections (rental arrivals and storm reconnects), measured from the attempt;
  • tip_delivery per churn tip, over the sessions connected at the tip: served, left before served (excluded), and unserved.

The run-wide time_to_usable_work is restricted to the run's own --sessions. Before, a rental connecting later counted its first job on a still-current warm-up tip.

Gates and presets.

  • Two new gates: churn_tip_last_notify_p99_budget_ms and new_session_first_job_p99_budget_ms.
  • The new rental-churn preset runs nightly on 8 vCPU. It takes the mainnet-floor population in a tips plan, then 300 s of churn: bursts of 100, 500 and 2,000 sessions within 10 s, Pareto(1.2) lifetimes from 30 s, storms of 10%, 25% and 50%, and 8 tips. It is gated on reconciliation, connected-at-tip p99 3 s and first-job p99 10 s. No workflow change is needed: the nightly matrix is read from the presets.
  • The smoke preset gains a 30 s churn phase: bursts of 20 and 40, a 30% storm, and 2 tips.

Verification

  • cargo fmt --check and cargo clippy -p qbit-prism-load --all-targets -D warnings are clean.
  • qbit-prism-load tests pass: 136 harness, 21 realism/preset/gate, 6 new churn unit tests (parsing and refusals, plan determinism, bursts, lifetimes, storms, the connection cap, connected-at-tip delivery over synthetic timelines, churn gates), quorum, and the smoke test.
  • Per-PR CI cost of the smoke test rises to about 95 s on its shard (about 22 s building the debug server, 71 s running), from about 52 s.
  • Mutant: a server that stalls every new connection's first job by 6 s fails the smoke test (new-session first-job p99 12.5 s against a 5 s budget).
  • Local rental-churn run (release builds, private PostgreSQL 16 with fsync on, a shared development host, so indicative): PASS.
    • Exit 0 and reconciled exactly.
    • 2,600 rentals spawned; 2,142 left abruptly; 3 storms.
    • Peak 2,528 concurrent sessions; at most 213 connects/s.
    • Tip delivery to connected sessions: p99 763 ms over 8 tips.
    • New-session first job: p99 16 ms over 3,581 connections.
    • Whale share of accepted work: 85.1%.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…res, reconnect storms, and a rental-churn nightly preset (#521)

Production does not hold a fixed set of sessions. Hash rental arrives as a
burst of sessions within seconds, mines for a heavy-tailed lifetime and
leaves by dropping its sockets. A rental failing over between pools drops
and reconnects many sessions at once. Mainnet records no connection
velocity, so the model is a seeded parameter sweep, off by default and
pinned by presets.

--churn-seconds adds a churn side phase after slow_database (after warm-up
under --plan tips), with no proxy delay and outside the artifact. In it:
- Rental bursts (--rental-bursts: a list or pareto/lognormal draws) connect
  within a burst window. The rentals mine for the heaviest address at
  --rental-hashrate times a mean session.
- Each rental leaves after a seeded heavy-tailed lifetime by closing its
  socket with no quiesce. Its abandoned submits are recorded as churn
  closes. A share the server committed anyway is reported as such, never as
  an ACK/commit divergence.
- Reconnect storms drop a seeded fraction of the connected sessions, which
  come back within a seeded delay.
- --churn-tips mints tips through the phase.
The connection cap and file-descriptor limit are sized for the peak
rentals.

The report's churn block records:
- the plan and the realised churn: spawns, departures, abrupt closes,
  storms, reconnects, and connects and concurrent sessions per second;
- new-session time to first job;
- per-tip delivery over the sessions connected at the tip: served, left
  first, or unserved.
Two new gates hold the connected-at-tip p99 and the first-job p99. The
run-wide time_to_usable_work stays over the run's own sessions.

The rental-churn preset (nightly, 8 vCPU) runs the mainnet-floor population
through bursts of 100, 500 and 2,000 sessions within 10 s, Pareto(1.2)
lifetimes from 30 s, and storms of 10%, 25% and 50%, with 8 tips. The smoke
preset gains a 30 s churn phase.

Refs #521

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@djh58
djh58 requested a review from kiwidream September 28, 2026 19:38
@djh58
djh58 merged commit c99abdd into 3.x.x Sep 28, 2026
21 checks passed
@djh58

djh58 commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

Review ledger (head d663a651, CI green)

CI. All 20 checks pass. The gated smoke test now includes a 30 s churn phase and ran in about 89 s on its shard (15 s building the debug server, 74 s running). Its results:

  • tip to last notify: p99 1.45 s over the warm-up tips;
  • delivery to the sessions connected at each churn tip: p99 2.0 s;
  • new-session first job: p99 157 ms over 105 connections;
  • 60 rentals spawned, 42 departed abruptly, 1 storm.

Review (/code-review, low, on the harness source).

# Finding Disposition
1 A storm counts every unpaused session as connected. If --storm-reconnect-seconds is at least --storm-interval-seconds, a session still offline from the previous storm can be picked again; the client ignores that Depart, so dropped overstates the realised storm Known limitation, not reachable by any checked-in preset: the reconnect windows are 3-5 s against storm intervals of 20-90 s. A follow-up PR adds an entry check refusing a reconnect window at least as long as the storm interval, with a test

Mutant. A server that stalls every new connection's first job by 6 s fails the smoke test: new-session first-job p99 was 12.5 s against the 5 s budget.

Local rental-churn run (release builds, private PostgreSQL 16 with fsync on, a shared development host, so indicative): pass. Exit 0, reconciled exactly.

  • 2,600 rentals spawned; 2,142 left abruptly; 3 storms.
  • Peak 2,528 concurrent sessions; at most 213 connects/s.
  • Delivery to connected sessions: p99 763 ms over 8 tips.
  • First job: p99 16 ms over 3,581 connections.

djh58 added a commit that referenced this pull request Sep 28, 2026
…, and a storm-window entry check (#521) (#559)

Presets are renamed for what they measure:
- throughput-20k-window-1fe[-500-addresses], from d1-20k[-realistic];
- throughput-{200,400,500}k-window-{1,2,4}fe-{async,sync}, from #473's d1-473 cells;
- tip-delivery-2000-miners-400k-2fe-retarget[-500-addresses], from tip-275[-realistic]. The 500-address variant is now manual;
- mainnet-shape-{130,650,2600}-addresses, from mainnet-floor, growth-5x and growth-20x;
- rental-churn-bursts-and-storms;
- pr-smoke.
Their flags are unchanged, and each description keeps its issue references. The old names still select their presets for one release: presets/aliases.txt is read by the matrix planner (the dispatch preset input) and by prism-load-run.sh, each with a deprecation warning.

The nightly matrix builds once. The plan job pins the ref to one commit.
A single job builds the release server, harness and gate there, and ships
them with their Cargo dep-info. Each preset job checks out that commit and
unpacks the binaries into target/release, so the harness still ties the
server to the checkout. It no longer installs Rust or builds.

With more than one reconnect storm, --storm-reconnect-seconds must now be
shorter than --storm-interval-seconds. Otherwise a storm could pick
sessions the previous one left offline, whose closes the client ignores,
and overstate its drops (#539 review).

Refs #521

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

1 participant