Parallelisation when enabling JetStream#7482
Merged
neilalexander merged 2 commits intomainfrom Oct 30, 2025
Merged
Conversation
Member
How was this tested? Do we have a confirmation that startup time actually improves with this? |
Signed-off-by: Neil Twigg <neil@nats.io>
e58e187 to
6493055
Compare
Member
Author
|
With With |
Signed-off-by: Neil Twigg <neil@nats.io>
81c760d to
a4cdfe0
Compare
neilalexander
added a commit
that referenced
this pull request
Oct 30, 2025
neilalexander
added a commit
that referenced
this pull request
Nov 3, 2025
Due to the stream restore parallelization introduced in #7482, we can panic on `access time service not running`. Since `ats.Register()` can now be called in parallel as well. We can simply store an initial value, on startup it's no issue that this timestamp is only slightly stale. Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
neilalexander
added a commit
that referenced
this pull request
Nov 5, 2025
neilalexander
added a commit
that referenced
this pull request
Nov 7, 2025
Continues from #7482 but this will give us a bit more headroom, as `dios` are often less than the full core count and are often the limiting factor anyway. Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander
added a commit
that referenced
this pull request
Nov 7, 2025
Continues from #7482 but this will give us a bit more headroom, as `dios` are often less than the full core count and are often the limiting factor anyway. Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander
added a commit
that referenced
this pull request
Nov 7, 2025
Continues from #7482 but this will give us a bit more headroom, as `dios` are often less than the full core count and are often the limiting factor anyway. Signed-off-by: Neil Twigg <neil@nats.io>
neilalexander
added a commit
that referenced
this pull request
Nov 7, 2025
Continues from #7482 but this will give us a bit more headroom, as `dios` are often less than the full core count and are often the limiting factor anyway. Signed-off-by: Neil Twigg <neil@nats.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces parallelisation into the JetStream startup, which should hopefully reduce startup time on systems with many streams, large streams or with higher numbers of CPU cores available.
A second subtle change is introduced here, which is that consumers are started immediately after their parent stream, rather than collected and started afterwards. Same for updating the interest state. This was originally broken out into different steps to ensure that sourcing consumers would work right in very old versions, but this is no longer relevant as ephemeral sourcing consumers are now created/recreated automatically as needed in the background.
Signed-off-by: Neil Twigg neil@nats.io