1625567290 commented on issue #21442: URL: https://github.com/apache/pulsar/issues/21442#issuecomment-1812704939
> Sorry for late reply. > > The current publish rate limiting is based on setting the `autoRead` flag of the Netty channel to false. However, `autoRead` is just a hint in Netty, not a guarantee (if anyone is familiar with this, a detailed explanation would be great). As a result, topics that have already been rate-limited may call the `isTopicPublishRateExceeded` method multiple times before the next rate-limiting period arrives, which is unnecessary. So, an optimization I'm thinking of is to set a flag after a topic triggers rate limiting, to avoid having to check whether the topic has already been rate-limited through the `isTopicPublishRateExceeded` method each time. > > Of course, we can also optimize the implementation of `org.apache.pulsar.common.util.RateLimiter`. Perhaps an implementation based on Compare-And-Swap (CAS) would perform better than `synchronized`. All of these ideas need to be validated through experimentation. Sorry, I am a beginner of pulsar, there is a problem I don't understand, can you help me solve it? The questioner has said affected other theme writing efficiency, the current theme open preciseTopicPublishRateLimiterEnable, why can affect other theme. I can't find the answer according to your answer, can you help me? -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org