Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

(2.12.1+) Atomic batch: R1 async flush#7298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
MauriceVanVeen wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frommaurice/batch-r1-perf

Conversation

@MauriceVanVeen
Copy link
Member

At the time of writing using batching with a replicated stream has increased performance over using async publish. However, when using a R1 stream, batching has worse performance than using async publish.

This PR fixes part of that, by having all streams (also R1) use async flush, but ensure we flush manually when required. Allowing batching to not flush for each individualprocessJetStreamMsg call, and just flush after the last message. This is safe, because we don't clean up the batch until after we've flushed.

Some local benchmarking has shown ~25% performance increase when using batching for R1, but it's still ~20% slower than using async publish. This is because async publish with R1 can simply immediately persist the data, whereas batching needs to persist and flush this into a staging batch-stream, and only persist into the stream itself after commit. All while holding the stream lock, so ingest of new batches is also halted during commit.

When also swapping the file-based stream for storing the R1 batch prior to commit with an in-memory stream (that replicated streams use to stage batches), the performance increases by ~60%. But, that's totally unsafe and doesn't survive hard kills, so that only illustrates staging the batch on disk prior to commit is what's the primary bottleneck.

Signed-off-by: Maurice van Veengithub@mauricevanveen.com

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeenMauriceVanVeen requested a review froma team as acode ownerSeptember 11, 2025 10:06
@MauriceVanVeenMauriceVanVeen marked this pull request as draftSeptember 11, 2025 10:39
@MauriceVanVeen
Copy link
MemberAuthor

Think we should land this after 2.12.0 ships. Couple other fixes in the pipeline that are more important to be included than this one.

@MauriceVanVeenMauriceVanVeen changed the title(2.12) Atomic batch: R1 async flush(2.12.1+) Atomic batch: R1 async flushSep 15, 2025
@github-actionsgithub-actionsbot added the staleThis issue has had no activity in a while labelNov 11, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

staleThis issue has had no activity in a while

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@MauriceVanVeen

[8]ページ先頭

©2009-2025 Movatter.jp