zhangbitao opened a new issue #4777: Can't limits consumer's rate using command 
"set-subscription-dispatch-rate"
URL: https://github.com/apache/pulsar/issues/4777
 
 
   **Describe the bug**
   Can't limits consumer's rate using command "set-subscription-dispatch-rate"
   
   **To Reproduce**
   
   1.  Set subscription message-dispatch-rate
   
   ```
   # bin/pulsar-admin namespaces set-subscription-dispatch-rate public/default 
--msg-dispatch-rate 10 --dispatch-rate-period 1
   
   {
     "dispatchThrottlingRateInMsg" : 10,
     "dispatchThrottlingRateInByte" : -1,
     "ratePeriodInSecond" : 1
   }
   ```
   
   2. case 1:  Set Batching=true in pulsar.ProducerOptions, but the result 
doesn't I want
   
   ```
   producer, err := client.CreateProducer(pulsar.ProducerOptions{
        Topic:              test-topic-1,
        Batching:           true,
        BlockIfQueueFull:   true,
        SendTimeout:        10,
        MaxPendingMessages: 10000,
   })
   ```
   
   ```
   # ./pulsar-admin  topics stats persistent://public/default/test-topic-1
   
   {
     "msgRateIn" : 0.0,
     "msgThroughputIn" : 0.0,
     "msgRateOut" : 583.2003004842348,
     "msgThroughputOut" : 616088.1840958354,
     "averageMsgSize" : 0.0,
     "storageSize" : 1849634,
     "publishers" : [ ],
     "subscriptions" : {
       "test-1" : {
         "msgRateOut" : 583.2003004842348,
         "msgThroughputOut" : 616088.1840958354,
         "msgRateRedeliver" : 0.0,
         "msgBacklog" : 14,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "Exclusive",
         "activeConsumerName" : "145283",
         "msgRateExpired" : 0.0,
         "consumers" : [ {
           "msgRateOut" : 583.2003004842348,
           "msgThroughputOut" : 616088.1840958354,
           "msgRateRedeliver" : 0.0,
           "consumerName" : "145283",
           "availablePermits" : -955,
           "unackedMessages" : 0,
           "blockedConsumerOnUnackedMsgs" : false,
           "metadata" : { },
           "address" : "/10.111.4.158:29127",
           "connectedSince" : "2019-07-22T19:32:24.877+08:00",
           "clientVersion" : "2.3.1"
         } ],
         "isReplicated" : false
       }
     },
     "replication" : { },
     "deduplicationStatus" : "Disabled"
   }
   ```
   
   3. case 2:  Set Batching=false in pulsar.ProducerOptions, but the result 
doesn't I want
   
   ```
   producer, err := client.CreateProducer(pulsar.ProducerOptions{
        Topic:              test-topic-1,
        Batching:           false,
        BlockIfQueueFull:   true,
        SendTimeout:        10,
        MaxPendingMessages: 10000,
   })
   ```
   
   ```
   ./pulsar-admin  topics stats persistent://public/default/test-topic-1
   
   {
     "msgRateIn" : 0.0,
     "msgThroughputIn" : 0.0,
     "msgRateOut" : 50.14999267057858,
     "msgThroughputOut" : 52904.95893460692,
     "averageMsgSize" : 0.0,
     "storageSize" : 7004225,
     "publishers" : [ ],
     "subscriptions" : {
       "test-1" : {
         "msgRateOut" : 50.14999267057858,
         "msgThroughputOut" : 52904.95893460692,
         "msgRateRedeliver" : 0.0,
         "msgBacklog" : 53,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "Exclusive",
         "activeConsumerName" : "145283",
         "msgRateExpired" : 0.0,
         "consumers" : [ {
           "msgRateOut" : 50.14999267057858,
           "msgThroughputOut" : 52904.95893460692,
           "msgRateRedeliver" : 0.0,
           "consumerName" : "145283",
           "availablePermits" : -917,
           "unackedMessages" : 0,
           "blockedConsumerOnUnackedMsgs" : false,
           "metadata" : { },
           "address" : "/10.111.4.158:29127",
           "connectedSince" : "2019-07-22T19:32:24.877+08:00",
           "clientVersion" : "2.3.1"
         } ],
         "isReplicated" : false
       }
     },
     "replication" : { },
     "deduplicationStatus" : "Disabled"
   }
   ```
   
   4. case 3:  Set Batching=true and BatchingMaxMessages=2 in 
pulsar.ProducerOptions, but the result doesn't I want
   
   ```
   producer, err := client.CreateProducer(pulsar.ProducerOptions{
        Topic:              test-topic-1,
        Batching:           true,
        BlockIfQueueFull:   true,
        SendTimeout:        10,
        MaxPendingMessages: 10000,
           BatchingMaxMessages: 2,
   })
   ```
   
   ```
   # ./pulsar-admin  topics stats persistent://public/default/test-topic-1
   
   {
     "msgRateIn" : 0.0,
     "msgThroughputIn" : 0.0,
     "msgRateOut" : 19.983333794948344,
     "msgThroughputOut" : 21562.417164758503,
     "averageMsgSize" : 0.0,
     "storageSize" : 51715374,
     "publishers" : [ ],
     "subscriptions" : {
       "test-1" : {
         "msgRateOut" : 19.983333794948344,
         "msgThroughputOut" : 21562.417164758503,
         "msgRateRedeliver" : 0.0,
         "msgBacklog" : 1351,
         "blockedSubscriptionOnUnackedMsgs" : false,
         "msgDelayed" : 0,
         "unackedMessages" : 0,
         "type" : "Exclusive",
         "activeConsumerName" : "145283",
         "msgRateExpired" : 0.0,
         "consumers" : [ {
           "msgRateOut" : 19.983333794948344,
           "msgThroughputOut" : 21562.417164758503,
           "msgRateRedeliver" : 0.0,
           "consumerName" : "145283",
           "availablePermits" : 708,
           "unackedMessages" : 0,
           "blockedConsumerOnUnackedMsgs" : false,
           "metadata" : { },
           "address" : "/10.111.4.158:29127",
           "connectedSince" : "2019-07-22T19:32:24.877+08:00",
           "clientVersion" : "2.3.1"
         } ],
         "isReplicated" : false
       }
     },
     "replication" : { },
     "deduplicationStatus" : "Disabled"
   }
   ```
   
   **Expected behavior**
   
   "msgRateOut"  is  about 10.0
   
   **Desktop (please complete the following information):**
    - OS:  Linux x86_64 GNU/Linux
    - Producer: pulsar-2.4.0
    - Consumer: pulsar-2.3.1

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to