Skip to content

perf(zero-cache): batch v6 websocket change frames - #9

Closed
Karavil wants to merge 1 commit into
capy/rm-vs-load-hot-queue-helpersfrom
capy/rm-vs-load-v6-websocket-batches
Closed

perf(zero-cache): batch v6 websocket change frames#9
Karavil wants to merge 1 commit into
capy/rm-vs-load-hot-queue-helpersfrom
capy/rm-vs-load-v6-websocket-batches

Conversation

@Karavil

@Karavil Karavil commented May 26, 2026

Copy link
Copy Markdown
Owner

what changed

Preserves the v6 Downstream payload shape while allowing websocket batch frames and subscribeBatched(). Incremental sync flushes the worker batch after a received websocket frame.

ACK semantics stay per-message in this PR.

benchmark output

medium-wide-batch-pressure, 15s, compared to hot queue helpers:

tx/s: 1,652.3 -> 2,099.4
rows/s: 33,046.2 -> 41,987.6
fanout msg/s: 51,531.8 -> 68,585.4
websocket messages: 807,248 -> 557
websocket ACKs: 807,248 -> 1,046,498
reconnect catchup to join: 1,658.3 ms -> 275.1 ms

The ACK count rises because this PR intentionally keeps old v6 per-message ACK behavior while batching frames.

validation

pnpm exec vitest --project='*no-pg*' run src/types/streams.test.ts src/services/change-streamer/subscriber.test.ts src/services/replicator/worker-message-batcher.test.ts bench/rm-vs-load/config.test.ts bench/rm-vs-load/scenarios.test.ts bench/rm-vs-load/workloads.test.ts
pnpm exec vitest --project='*15*' run src/services/change-streamer/change-streamer-http.pg.test.ts src/services/change-streamer/change-streamer-service.pg.test.ts src/services/change-streamer/storer.pg.test.ts
pnpm run check-types

Why: reduce RM to serving-replica websocket overhead while preserving the v6 Downstream payload and per-message ACK semantics.

* add stream batch frames and subscribeBatched for change streams

* keep websocket batch boundaries visible through incremental sync worker flushing

* update the rm-vs-load harness to benchmark websocket batch frames
@Karavil
Karavil force-pushed the capy/rm-vs-load-v6-websocket-batches branch from 4a4431c to 9ca34bf Compare May 26, 2026 19:02
@Karavil

Karavil commented May 26, 2026

Copy link
Copy Markdown
Owner Author

Replaced by rocicorp/mono PRs rocicorp#6070 through rocicorp#6078.

@Karavil Karavil closed this May 26, 2026
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