merlimat commented on pull request #7499:
URL: https://github.com/apache/pulsar/pull/7499#issuecomment-932560754


   > @merlimat
   > 
   > > I still think we shouldn't add contended counters. We have validated 
that previous OOMs are not happening anymore in 2.8. Even then, I still believe 
we should go with thread-local approach, by dynamically adjusting per-thread 
quotas.
   > 
   > This PR uses LongAdder counter instead contented atomic counter which 
should avoid contention in the write path. The benefit of this approach is 
predictable throttling at broker level rather at the thread level. my worry is 
#7406 definitely has issue of uniform resource distribution and dynamic 
resource adjustment eventually follow the same model but in a little complex 
way??
   
   @rdhabalia the problem in this implementation is that does not guarantee 
that the max limit (in term of messages or bus) is respected, since the check 
is done in background every few seconds (given that LongAdder.sum() is 
expensive). It's very possible that a traffic spike will to cause an OOM 
between the checks.
   


-- 
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