Skip to content

perf(relay): batch audit chain writes; fix perf harness - #4957

Open
grave0x wants to merge 1 commit into
block:mainfrom
grave0x:perf/audit-batching
Open

perf(relay): batch audit chain writes; fix perf harness#4957
grave0x wants to merge 1 commit into
block:mainfrom
grave0x:perf/audit-batching

Conversation

@grave0x

@grave0x grave0x commented Aug 5, 2026

Copy link
Copy Markdown

Batches the per-community audit hash-chain writes (6N DB round-trips → ~6 per batch) so ingest latency stops being equal to audit-write latency, and fixes the perf harness's wedged-subscriber bug. Chain output byte-identical to sequential writes (new tests included).

@grave0x
grave0x requested a review from a team as a code owner August 5, 2026 20:34
Copilot AI lite review requested due to automatic review settings August 5, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

- buzz-audit: AuditService::log_batch amortizes the per-community
  advisory lock, head read, transaction, and commit across a whole batch.
  The hash chain is computed in-process in arrival order — byte-identical
  to N sequential log() calls (proven by new chain tests).
- buzz-relay: audit worker drains up to 256 buffered entries per lock
  acquisition and writes each community's entries as one multi-row INSERT,
  decoupling ingest latency from audit write latency (6N round-trips -> ~6
  per batch).
- perf: fix relay_bus_scaling.py subscriber wedged by Python's
  socket.makefile() timeout bug (gh-77716); harness now produces the
  measured bus-scaling numbers instead of always timing out.

Signed-off-by: GitHub Actions Bot <16064504+grave0x@users.noreply.github.com>
@grave0x
grave0x force-pushed the perf/audit-batching branch from b3143f0 to e4e4036 Compare August 5, 2026 20:35
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