Skip to content

perf(server-ng): reach single-node latency parity with legacy server#3746

Open
hubcio wants to merge 3 commits into
masterfrom
feat/server-ng-perf
Open

perf(server-ng): reach single-node latency parity with legacy server#3746
hubcio wants to merge 3 commits into
masterfrom
feat/server-ng-perf

Conversation

@hubcio

@hubcio hubcio commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

server-ng trailed the legacy server on single-node benchmarks:
the default cpu allocation collapsed all work onto one shard,
produce hashed each batch three times (convert, stamp, flush
revalidation), and a lone consumer crossing a sealed segment
degraded to full-segment scans through unbounded read handles.

Shard allocation now defaults to numa:auto. Produce computes
the batch checksum once and marks locally originated batches
trusted; replicated blobs keep a per-message receive gate on
followers, so transit integrity still holds end to end. Sealed
segment read handles are capped by a per-partition LRU.

Consumer groups on the ng metadata plane gain legacy-parity
error semantics: join/leave against a missing stream, topic or
group fail loudly (1009/2010/5000), leaving as an absent member
returns 5006 instead of silent success, and the wire codes are
pinned by an integration test across TCP, QUIC and WebSocket.
The HTTP listener now binds from the cluster roster port, so
one-host clusters run from byte-identical per-node configs.

server-ng trailed the legacy server on single-node benchmarks:
the default cpu allocation collapsed all work onto one shard,
produce hashed each batch three times (convert, stamp, flush
revalidation), and a lone consumer crossing a sealed segment
degraded to full-segment scans through unbounded read handles.

Shard allocation now defaults to numa:auto. Produce computes
the batch checksum once and marks locally originated batches
trusted; replicated blobs keep a per-message receive gate on
followers, so transit integrity still holds end to end. Sealed
segment read handles are capped by a per-partition LRU.

Consumer groups on the ng metadata plane gain legacy-parity
error semantics: join/leave against a missing stream, topic or
group fail loudly (1009/2010/5000), leaving as an absent member
returns 5006 instead of silent success, and the wire codes are
pinned by an integration test across TCP, QUIC and WebSocket.
The HTTP listener now binds from the cluster roster port, so
one-host clusters run from byte-identical per-node configs.
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 24, 2026
@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.27778% with 98 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.31%. Comparing base (d9635b6) to head (7bf57b2).

Files with missing lines Patch % Lines
core/server_common/src/send_messages2.rs 94.07% 12 Missing and 14 partials ⚠️
core/partitions/src/iggy_partition.rs 85.98% 17 Missing and 5 partials ⚠️
core/server-ng/src/bootstrap.rs 79.71% 13 Missing and 1 partial ⚠️
core/partitions/src/poll_plan.rs 83.05% 6 Missing and 4 partials ⚠️
core/metadata/src/stm/stream.rs 10.00% 9 Missing ⚠️
core/partitions/src/log.rs 94.56% 4 Missing and 1 partial ⚠️
core/metadata/src/stm/consumer_group.rs 96.89% 4 Missing ⚠️
core/partitions/src/iggy_index_reader.rs 80.00% 1 Missing and 3 partials ⚠️
core/metadata/src/stm/result.rs 88.88% 2 Missing ⚠️
core/partitions/src/iggy_partitions.rs 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3746       +/-   ##
=============================================
- Coverage     74.53%   61.31%   -13.23%     
  Complexity      969      969               
=============================================
  Files          1306     1305        -1     
  Lines        150028   139603    -10425     
  Branches     125462   115111    -10351     
=============================================
- Hits         111829    85594    -26235     
- Misses        34700    50366    +15666     
- Partials       3499     3643      +144     
Components Coverage Δ
Rust Core 58.71% <90.27%> (-16.13%) ⬇️
Java SDK 62.71% <ø> (ø)
C# SDK 71.14% <ø> (-1.13%) ⬇️
Python SDK 92.27% <ø> (ø)
PHP SDK 84.52% <ø> (ø)
Node SDK 92.24% <ø> (ø)
Go SDK 43.08% <ø> (ø)
Files with missing lines Coverage Δ
core/journal/src/prepare_journal.rs 88.67% <ø> (ø)
core/metadata/src/stm/snapshot.rs 86.30% <100.00%> (ø)
core/partitions/src/journal.rs 77.77% <100.00%> (ø)
core/server-ng/src/dispatch.rs 33.38% <ø> (ø)
core/server-ng/src/partition_reconciler.rs 86.31% <100.00%> (ø)
core/server-ng/src/responses.rs 39.76% <ø> (ø)
core/simulator/src/client.rs 57.05% <ø> (ø)
core/metadata/src/stm/result.rs 92.03% <88.88%> (-0.31%) ⬇️
core/partitions/src/iggy_partitions.rs 69.76% <33.33%> (-0.34%) ⬇️
core/metadata/src/stm/consumer_group.rs 68.08% <96.89%> (+10.15%) ⬆️
... and 7 more

... and 252 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

hubcio added 2 commits July 24, 2026 20:45
The per-message checksum was computed by streaming three hasher
writes over disjoint slices before the parts were copied into the
output buffer. Reorder each encode site to write first, then hash
the contiguous output span and stamp the checksum field, and let
the follower receive gate hash the received blob span directly.

The digest formula is unchanged: XxHash3-64 over the 40-byte
header tail plus payload and user headers, now pinned by a
streaming-vs-oneshot reference test instead of an implicit
helper. Measured CPU-neutral on the produce hot path (both modes
hit the same vectorized kernel at ~1KB messages), so this is a
readability and test-coverage change, not a perf one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant