Gleiphir2769 opened a new pull request, #989:
URL: https://github.com/apache/pulsar-client-go/pull/989

   ### Motivation
   
   Currently, when the rate of the producer is set relatively small, the actual 
production rate is not accurate.
   
   For example, set the rate aas 1.
   
   ```
   $ ./pulsar-perf-old produce my-test-r1 -r 1
   
   INFO[17:20:12.524] Stats - Publish rate:    2.9 msg/s -    0.0 Mbps - 
                                   Latency ms: 50%   3.8 -95% 1004.0 - 99% 
1004.3 - 99.9% 1004.3 - max 1005.2 
   INFO[17:20:22.523] Stats - Publish rate:    3.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50%   3.8 -95% 1004.0 - 99% 
1004.2 - 99.9% 1004.2 - max 1004.9 
   INFO[17:20:32.523] Stats - Publish rate:    3.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50%   3.9 -95% 1004.0 - 99% 
1004.0 - 99.9% 1004.0 - max 1004.1 
   
   ```
   
   After modify the rate limiter, the result can be improved as that.
   
   ```
   $ ./pulsar-perf produce my-test-r1 -r 1
   
   INFO[17:22:45.971] Stats - Publish rate:    1.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50% 1004.4 -95% 1005.1 - 99% 
1005.1 - 99.9% 1005.1 - max 1006.2 
   INFO[17:22:55.971] Stats - Publish rate:    1.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50% 1004.2 -95% 1007.4 - 99% 
1007.4 - 99.9% 1007.4 - max 1008.0 
   INFO[17:23:05.971] Stats - Publish rate:    1.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50% 1003.4 -95% 1004.7 - 99% 
1004.7 - 99.9% 1004.7 - max 1008.1 
   INFO[17:23:15.971] Stats - Publish rate:    1.0 msg/s -    0.0 Mbps - 
                                   Latency ms: 50% 1003.5 -95% 1004.3 - 99% 
1004.3 - 99.9% 1004.3 - max 1004.6 
   
   ```
   
   ### Modifications
   
   - Use the "golang.org/x/time/rate" as producer limiter.
   
   ### Verifying this change
   
   - [x] Make sure that the change passes the CI 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