lhotari commented on issue #25540:
URL: https://github.com/apache/pulsar/issues/25540#issuecomment-4261938708

   > * PIP-299: `dispatcherPauseOnAckStatePersistentEnabled` — pauses 
dispatching at the limit, but also operates silently (no log at the transition)
   
   Btw, the PIP-299 solution doesn't always prevent overflowing. For Key_Shared 
subscriptions, there's a solution that improves the situation in 
https://github.com/apache/pulsar/pull/23231. A similar solution for Shared 
subscriptions could also be helpful.
   
   The tuning of persistence for individual deleted messages is explained in 
this discussion comment: 
https://github.com/apache/pulsar/discussions/23990#discussioncomment-12232981
   
   ```
   managedLedgerMaxUnackedRangesToPersist=200000
   managedLedgerMaxBatchDeletedIndexToPersist=200000
   managedLedgerPersistIndividualAckAsLongArray=true
   managedCursorInfoCompressionType=LZ4
   managedLedgerInfoCompressionType=LZ4
   ```
   
   This also requires `managedLedgerUnackedRangesOpenCacheSetEnabled=true`, 
which is the default.
   The `managedLedgerInfoCompressionType` tuning is unrelated to this issue; 
it's relevant when there's a very large number of ledgers for a topic. It's 
still worth enabling compression so that the limit isn't hit at some point in 
large use cases.
   
   With this configuration, you should be able to bump 
`managedLedgerMaxUnackedRangesToPersist` to `500000` (or higher). This will 
require more memory if state was frequently lost before, so it's worth testing 
in your own use cases before rolling out to production.
   
   Increasing `managedLedgerMaxBatchDeletedIndexToPersist` is also necessary, 
since overflowing this value for partially acknowledged batch messages would 
otherwise cause state to be lost and result in unnecessary redeliveries. This 
setting was previously hard coded to 10000; it became configurable in 
https://github.com/apache/pulsar/pull/24392 starting from 3.0.13/4.0.6 ([docs 
in 
broker.conf](https://github.com/apache/pulsar/blob/4998cd9e4f66ade6a7972da4afcd0f1546ddfc16/conf/broker.conf#L1429-L1434)).
   
   Please note that the full set of tuning options is only supported on fairly 
recent broker versions of 3.0.x and 4.0.x. I'd recommend using 3.0.16 (expired 
LTS) or 4.0.9 (current LTS).
   
   > Happy to submit a PR if a maintainer agrees this is worth adding.
   
   Thanks for volunteering, this would be very helpful. Adding documentation 
for the tuning together with the warning log in code will help.
   
   Providing tuning advice in the log message would be useful, although it 
could get quite verbose. The advice should also cover 
`managedLedgerPersistIndividualAckAsLongArray` and 
`managedCursorInfoCompressionType`.
   Overflowing `managedLedgerMaxBatchDeletedIndexToPersist` would require a 
separate warning message.
   
   I'll open an issue about improving the defaults. Please go ahead with the 
warning log (and any documentation improvements).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to