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

[PIP-111] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB #13170

Closed
gaozhangmin opened this issue Dec 7, 2021 · 1 comment

Comments

@gaozhangmin
Copy link
Contributor

Motivation

MaxMessagePublishBufferSizeInMB is used to limit the direct memory usage for reading messages from producers, default value is 1/2 of direct memory.
The problem is:
If we enable any Protocol Handler in broker such as KoP, the direct memory to buffer the pending messages from Kafka producers is not limited by maxMessagePublishBufferSizeInMB. And if we have Pulsar producers and Kafka producers sending message together with higher throughput than BookKeeper IO, broker OOM will happen.

Goal

When handling producer message, we could check if pending bytes from pulsar and protocol handler exceed maxMessagePublishBufferSizeInMB, if yes, stop reading from producer both in broker and Protocol Handler side.

API Changes

using a LongAdder in BrokerService to record the current pending bytes for entire broker

Implementation

To make effective use of memory, using a LongAdder in BrokerService to record the current pending bytes for entire broker, include both pulsar pending messages and Protocol Handler's pending messages.

Reject Alternatives

No alternatives yet.

@gaozhangmin gaozhangmin changed the title Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB [PIP] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB Dec 7, 2021
@merlimat merlimat changed the title [PIP] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB [PIP-107] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB Dec 9, 2021
@merlimat merlimat changed the title [PIP-107] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB [PIP-111] Add messages produced by Protocol Handler When checking maxMessagePublishBufferSizeInMB Dec 9, 2021
@github-actions
Copy link

The issue had no activity for 30 days, mark with Stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant