Skip to content

(2.12) Raise max_buffered_msgs defaults by 10x#6633

Merged
neilalexander merged 1 commit intomainfrom
max-msgs-limits
Aug 28, 2025
Merged

(2.12) Raise max_buffered_msgs defaults by 10x#6633
neilalexander merged 1 commit intomainfrom
max-msgs-limits

Conversation

@wallyqs
Copy link
Member

@wallyqs wallyqs commented Mar 10, 2025

  • Bump max_buffered_size to 100_000 by default

Signed-off-by: Waldemar Quevedo wally@nats.io

@wallyqs wallyqs requested a review from a team as a code owner March 10, 2025 22:03
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

In principle I think this is OK, as we discussed last week, but I think it needs some kind of test to prove that the server copes and there aren't secondary effects.

Maybe copy TestJetStreamRateLimitHighStreamIngest into a new long-running test to prove it?

@github-actions github-actions bot added the stale This issue has had no activity in a while label May 7, 2025
@neilalexander
Copy link
Member

Do we want to consider this for 2.12 or shall we close for now?

@wallyqs
Copy link
Member Author

wallyqs commented May 9, 2025

Should have been for v2.11 I think... we can close for now and revisit when needed.

@wallyqs wallyqs closed this May 9, 2025
@wallyqs wallyqs reopened this Aug 11, 2025
@neilalexander
Copy link
Member

What is the status of this?

@wallyqs
Copy link
Member Author

wallyqs commented Aug 20, 2025

These defaults have been working better in scale tests without the servers struggling much and fixed issues in larger deployments with >100K connections. Reopened to see if we can try to change defaults for v2.12.

@neilalexander
Copy link
Member

Wondering if there's a fairer balance somewhere for defaults, i.e. increasing the default msgs to 100,000 from 10,000. That way messages over 1KB would be more likely to hit the max size limit (if left at 128MB) and messages under 1KB would be more likely to hit the max messages limit.

Also keep in mind with the bump to 256MB that this is per stream, not server-wide, so I'm a bit less comfortable with increasing that too much. 128MB should be more than fair.

@wallyqs wallyqs changed the title v2.11: Disable max_buffered_msgs by default, bump max_buffered_size Disable max_buffered_msgs by default, bump max_buffered_size Aug 27, 2025
This will avoid running into IPQ len on simple benchmarks or use cases
that the server handles fine, the max_buffered_msgs is enough to protect
the memory usage in most cases.

Signed-off-by: Waldemar Quevedo <wally@nats.io>
@wallyqs wallyqs changed the title Disable max_buffered_msgs by default, bump max_buffered_size Raise max_buffered_msgs defaults by 10x Aug 28, 2025
Copy link
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@neilalexander neilalexander merged commit b7c3ac8 into main Aug 28, 2025
26 checks passed
@neilalexander neilalexander deleted the max-msgs-limits branch August 28, 2025 10:16
@MauriceVanVeen MauriceVanVeen changed the title Raise max_buffered_msgs defaults by 10x (2.12) Raise max_buffered_msgs defaults by 10x Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue has had no activity in a while

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants