buger / goreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.
https://goreplay.org
Other
18.53k stars 13 forks source link

Use the token bucket algorithm to optimize Limiter #1143

Closed code4wt closed 1 year ago

code4wt commented 1 year ago

The current limiting algorithm is a fixed window, which may lead to high burst traffic at the millisecond level, such as the following usage: gor --input-file "requests.gor|10000%" --output-http="http://test.com|500 Usage Scenario: QPS Stress Tests

The token bucket algorithm can avoid this situation and make the output traffic smoother

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication