Hi Jiaqi, >From what I see, this memory limitation is used for protecting the client from OOM when processing too many messages in the client. So setting a single client limitation is more easy for users and producer and consumer can share the memory.
Normally, we should set the limitation number to just small enough not causing OOM, but not just large enough for normal message processing which is hard to calculate. And having separate limitations for producer and consumer may make the choice of limitation number more tricky. Thanks, Haiting On Tue, Feb 28, 2023 at 10:26 AM Jiaqi Shen <gleiphir2...@gmail.com> wrote: > > Context. > - PIP-74 > https://github.com/apache/pulsar/wiki/PIP-74%3A-Pulsar-client-memory-limits > - PR-8965 https://github.com/apache/pulsar/pull/8965 > - PR-15216 https://github.com/apache/pulsar/pull/15216 > > Hello, community: > > There are some questions about PIP-74 I want to figure out. > > PIP-74 and its implementation specifie how to limit *client* memory. But in > our scenario, the *client* is usually reused. It is more intuitive to limit > a single *producer* or *consumer*. So why not let the producer/consumer > have their own MemoryLimitController? And shoud we split the > memoryLimit setting > into consumerMemoryLimit and producerMemoryLimit? Are there any other > considerations to limit *client* memory? > > If you know why it needs to be designed like this, please leave your > comment. Thanks! > > Thanks, > Jiaqi Shen