Skip to content

bench(6o-i8): large-transaction contention and memory (Investigation 1) - #202

Merged
akosidencio merged 1 commit into
devfrom
bench/v0.6o-i8-large-transactions
Nov 28, 2026
Merged

akosidencio merged 1 commit into
devfrom
bench/v0.6o-i8-large-transactions

Conversation

@akosidencio

Copy link
Copy Markdown
Member

Phase 6O-I8 PR 1: Investigation 1, the 10,000-write transaction cell from 6O-I's D6. Reports, tools and raw evidence only; no production code. The other two PRs of this phase (replica capacity, validation and the release gate) touch disjoint files under benchmarks/v0.6.0/6o-i8/ and can merge in any order.

Result: explained and bounded

Cell: 10,000-write transactions, 4 outside writers, 3 workers, a replica. P (dev 54ff38a) against H (6O-H, 6068337), 5 reps × 120 s, interleaved:

P / H
transactions/s 0.948× (0.938× on the quiet host, 0.969× with the replica on its own CPU)
primary CPU per transaction +3.3%
user instructions per transaction +8.2%
primary RSS +34 MiB, a plateau; it returns to H's level about 10 s after the load
outside writers −17% (range −27% to +4%)

Cause: ReplHub::publish (6O-I, kept by #200) allocates a transaction's replication objects in batches and frees the backlog's old frames in a batch. This overruns jemalloc's thread cache:

  • allocation requests are the same (60.4k per transaction);
  • refills from the arena double (10.7k → 20.5k);
  • dirty pages go from 19 to 54 MiB under the default 10 s decay, while the live heap is equal.

Controls:

  • thread cache off: P's instructions equal H's (1.000);
  • no replica: P = H;
  • no writers: the same cost;
  • the experimental px (per-frame publish, raw/px-patch/) restores instructions (0.998×), RSS (0.98×) and transactions (1.026×).

Scaling: instructions +1.7%, +2.0%, +5.4% and +8.2% at 100, 1k, 5k and 10k writes. At 1,000 writes P is faster than H (1.05–1.08×).

Locks: writers wait on the write-order stripes, never on the stream lock. The stream lock's maximum hold was 3.8 ms.

Not attributed: phase 1's +1.5–1.8% (P and px alike) and a per-hand-off writer residual.

Contents

  • Reports: V0.6O-I8-BASELINE.md, -BENCHMARK-METHODOLOGY.md, -LARGE-TRANSACTION-CONTENTION.md, -MEMORY-INVESTIGATION.md.
  • Tools:
    • tools/i8bench: the generator and exact verifier, standalone, not a workspace member;
    • tools/i8run.py: the driver;
    • summarizers, chart, timeline, stall, cycle and bounce tools, and the build and test scripts.
  • Raw data: every Investigation 1 campaign (e1 … ex3), plus the build logs, configs as run, the temporary diag instrumentation (never merged) and the px patch.

px is not proposed here. It is PR 3 of the brief and needs the maintainer's approval; see V0.6O-I8-RELEASE-GATE.md §3, in the validation PR.

Reviews: A (methodology, 3 rounds) approved with changes; B (memory and contention, 2 rounds) accepted with changes. All changes are applied.

D6's first finding, explained and bounded: 10,000-write transactions with
4 outside writers, 3 workers and a replica (P 54ff38a against H 6068337,
5 x 120 s): transactions 0.948x, CPU +3.3%, instructions +8.2%, RSS +34 MiB.

Cause: ReplHub::publish (6O-I, kept by #200) allocates a transaction's
replication objects in batches and frees the backlog's old frames in a
batch, overrunning jemalloc's thread cache: the same 60.4k requests per
transaction, refills 10.7k -> 20.5k, and dirty pages 19 -> 54 MiB under the
10 s decay (live heap equal; RSS plateaus and returns after the load).
Thread cache off: P's instructions equal H's (1.000). The experimental px
(per-frame publish, raw/px-patch, not proposed without approval) restores
instructions, RSS and the transaction rate.

About half the transaction loss is the replica sharing CPU 1 (e6: 0.969x
with it on CPU 5). Writers wait on the write-order stripes, never on the
stream lock (max hold 3.8 ms). Scaling: instructions +1.7/2.0/5.4/8.2% at
100/1k/5k/10k writes; P is faster than H at 1,000 writes (1.05-1.08x).
Not attributed: phase 1 +1.5-1.8% and a per-hand-off writer residual.

Reports: baseline, methodology, contention, memory. Tools: the i8bench
generator and verifier, the i8run.py driver, summarizers, chart, timeline,
stall, cycle and bounce tools, build and test scripts. Raw data for every
Investigation 1 campaign, the build logs, configs, the temporary diag
instrumentation (never merged) and the px patch.
@akosidencio
akosidencio merged commit 8446840 into dev Nov 28, 2026
13 checks passed
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