Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
util-core: Fixes AsyncMeter behavior with small burst sizes and small…
… periods Problem AsyncMeter's process is that it fills up the token bucket, and then uses the token bucket to give out permission to continue. The tricky thing here is that if the token bucket can only hold 1, then even if it's given permission to hold 2, it won't distribute load for two. Since we don't have arbitrary granularity timers, folks who select a maximum burst size of 1, but a frequency smaller than the granularity our timers can actually handle will not see the throughput they expect. Although we could simulate the right result by choosing a new burst size that better fits the timer's granularity, this introduces the problem of figuring out the timer's granularity, which can fluctuate given load. Solution When the meter is refilled, it allows the full disbursement of tokens to be used, instead of just what fits in the token bucket. RB_ID=836742
- Loading branch information
Showing
3 changed files
with
92 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters