You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lordcheng10 (via GitHub)" <gi...@apache.org> on 2023/05/10 09:01:50 UTC

[GitHub] [pulsar] lordcheng10 opened a new pull request, #20292: [feat][broker] introduce precise broker publish rate limiting

lordcheng10 opened a new pull request, #20292:
URL: https://github.com/apache/pulsar/pull/20292

   ### Motivation
   The publish rate limit for each broker is ineffective, and the reason for this problem is the same as https://github.com/apache/pulsar/pull/7078;
   
   ### Modifications
   When preciseTopicPublishRateLimiterEnable=true, use PrecisPublishLimiter as the publish rate limit for each broker.
   
   
   ### 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 -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: <!-- ENTER URL HERE -->
   
   <!--
   After opening this PR, the build in apache/pulsar will fail and instructions will
   be provided for opening a PR in the PR author's forked repository.
   
   apache/pulsar pull requests should be first tested in your own fork since the 
   apache/pulsar CI based on GitHub Actions has constrained resources and quota.
   GitHub Actions provides separate quota for pull requests that are executed in 
   a forked repository.
   
   The tests will be run in the forked repository until all PR review comments have
   been handled, the tests pass and the PR is approved by a reviewer.
   -->
   


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] aloyszhang commented on a diff in pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#discussion_r1191044794


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:
##########
@@ -1116,6 +1116,12 @@ public boolean isBrokerPublishRateExceeded() {
         return  getBrokerPublishRateLimiter().isPublishRateExceeded();
     }
 
+    public boolean isBrokerPublishRateExceeded(int numberMessages, int bytes) {
+        // whether broker publish rate exceed
+        return preciseTopicPublishRateLimitingEnable

Review Comment:
   It's better two use a distinguish configuration instead of `preciseTopicPublishRateLimitingEnable`



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lordcheng10 commented on a diff in pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "lordcheng10 (via GitHub)" <gi...@apache.org>.
lordcheng10 commented on code in PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#discussion_r1194562212


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:
##########
@@ -1116,6 +1116,12 @@ public boolean isBrokerPublishRateExceeded() {
         return  getBrokerPublishRateLimiter().isPublishRateExceeded();
     }
 
+    public boolean isBrokerPublishRateExceeded(int numberMessages, int bytes) {
+        // whether broker publish rate exceed
+        return preciseTopicPublishRateLimitingEnable

Review Comment:
   fixed.
   add config preciseBrokerPublishRateLimiterEnable



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lordcheng10 commented on pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "lordcheng10 (via GitHub)" <gi...@apache.org>.
lordcheng10 commented on PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#issuecomment-1543721453

   @aloyszhang PTAL,thanks!


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lordcheng10 commented on pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "lordcheng10 (via GitHub)" <gi...@apache.org>.
lordcheng10 commented on PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#issuecomment-1543237883

   @Jason918 PTAL,thanks!


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#issuecomment-1593975911

   The pr had no activity for 30 days, mark with Stale label.


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lordcheng10 commented on pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "lordcheng10 (via GitHub)" <gi...@apache.org>.
lordcheng10 commented on PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#issuecomment-1543231936

   @codelipenghui PTAL,thanks!


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lifepuzzlefun commented on pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "lifepuzzlefun (via GitHub)" <gi...@apache.org>.
lifepuzzlefun commented on PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#issuecomment-1543735608

   @lordcheng10 nice patch~ can you add a unit test to simulate this, maybe just check rate is below the setting is enough.


-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] aloyszhang commented on a diff in pull request #20292: [feat][broker] introduce precise broker publish rate limiting

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #20292:
URL: https://github.com/apache/pulsar/pull/20292#discussion_r1191044794


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java:
##########
@@ -1116,6 +1116,12 @@ public boolean isBrokerPublishRateExceeded() {
         return  getBrokerPublishRateLimiter().isPublishRateExceeded();
     }
 
+    public boolean isBrokerPublishRateExceeded(int numberMessages, int bytes) {
+        // whether broker publish rate exceed
+        return preciseTopicPublishRateLimitingEnable

Review Comment:
   It's better to use a distinguish configuration instead of `preciseTopicPublishRateLimitingEnable`



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org