LinkSettings.BurstWindow: size the token-bucket burst in line time - #8
Open
cskiraly wants to merge 1 commit into
Open
LinkSettings.BurstWindow: size the token-bucket burst in line time#8cskiraly wants to merge 1 commit into
cskiraly wants to merge 1 commit into
Conversation
…line time Why: the token bucket accumulates at most one MTU, which is exact under a virtual clock but loses capacity on the real clock -- every timer wake-up overshoots its deadline slightly, and a bucket that cannot bank the overshoot forfeits it, so a 50 Mbps link delivers ~21 Mbps under load. What: LinkSettings.BurstWindow sets how much line time the bucket may accumulate. Zero keeps the current one-MTU behaviour (and stays the right setting under Go's testing/synctest virtual clock, where it is faithful); real-clock users set a few milliseconds to absorb scheduler overshoot. Measured on a calibration harness: a 50 Mbps link delivers 50 Mbps on the real clock with a 5 ms window.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The token bucket accumulates at most one MTU, which is exact under a virtual clock but loses capacity on the real clock -- every timer wake-up overshoots its deadline slightly, and a bucket that cannot bank the overshoot forfeits it, so a 50 Mbps link delivers ~21 Mbps under load.
What changed: LinkSettings.BurstWindow sets how much line time the bucket may accumulate. Zero keeps the current one-MTU behaviour (and stays the right setting under Go's testing/synctest virtual clock, where it is faithful); real-clock users set a few milliseconds to absorb scheduler overshoot. Measured on a calibration harness: a 50 Mbps link delivers 50 Mbps on the real clock with a 5 ms window.