codelipenghui opened a new pull request, #20607: URL: https://github.com/apache/pulsar/pull/20607
### Motivation The issue should only happen on the topic with many producers, and the max producer limitation is enabled. When a new producer is added, the broker will check all the existing producers and filter out the remote producer (from the replicator), which will run out of the CPU resource for a short period of time. <img width="1907" alt="image" src="https://github.com/apache/pulsar/assets/12592133/14e74ed2-7ace-429b-9352-c643995e0e27"> [profiler.html.txt](https://github.com/apache/pulsar/files/11788992/profiler.html.txt) ### Modifications A counter will be much more efficient instead of going through all the producers. So a new userCreatedProducerCount is added to the topic. ### Verifying this change The existing tests already covered the max producer limitation. The change will not affect the correctness. ### Does this pull request potentially affect one of the following parts: <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> *If the box was checked, please highlight the changes* - [ ] Dependencies (add or upgrade a dependency) - [ ] The public API - [ ] The schema - [ ] The default values of configurations - [ ] The threading model - [ ] The binary protocol - [ ] The REST endpoints - [ ] The admin CLI options - [ ] The metrics - [ ] Anything that affects deployment ### Documentation <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. --> - [ ] `doc` <!-- Your PR contains doc changes. --> - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later --> - [x] `doc-not-needed` <!-- Your PR changes do not impact docs --> - [ ] `doc-complete` <!-- Docs have been already added --> -- 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]
