Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Adjust batch size in dispatcher so that a single batch doesn't exceed managedLedgerMaxReadsInFlightSizeInMB #23482

Open
1 of 2 tasks
lhotari opened this issue Oct 18, 2024 · 1 comment
Assignees
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages

Comments

@lhotari
Copy link
Member

lhotari commented Oct 18, 2024

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

Current managedLedgerMaxReadsInFlightSizeInMB will have to be set to value that is higher than dispatcherMaxReadBatchSize * maxMessageSize.

Otherwise it could result in error Time-out elapsed while acquiring enough permits on the memory limiter to read from ledger [ledgerid], [topic], estimated read size [read size] bytes for [dispatcherMaxReadBatchSize] entries (check managedLedgerMaxReadsInFlightSizeInMB).
dispatcherMaxReadBatchSize defaults to 100 and maxMessageSize defaults to 5MB in bytes.

This means that currently managedLedgerMaxReadsInFlightSizeInMB must be set to 500 or higher to prevent the issue from occurring in all cases.

Solution

Adjust batch size in dispatcher so that a single batch doesn't exceed managedLedgerMaxReadsInFlightSizeInMB

Alternatives

No response

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@lhotari lhotari added the type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages label Oct 18, 2024
@lhotari
Copy link
Member Author

lhotari commented Oct 23, 2024

There's another problem. The current solution expects that managedLedgerReadEntryTimeoutSeconds is set. It will fail immediately without waiting in that case, resulting in a similar exception. I filed #23506 for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement The enhancements for the existing features or docs. e.g. reduce memory usage of the delayed messages
Projects
None yet
Development

No branches or pull requests

1 participant