Skip to content

LinkSettings.BurstWindow: size the token-bucket burst in line time - #8

Open
cskiraly wants to merge 1 commit into
MarcoPolo:mainfrom
cskiraly:burst-window
Open

LinkSettings.BurstWindow: size the token-bucket burst in line time#8
cskiraly wants to merge 1 commit into
MarcoPolo:mainfrom
cskiraly:burst-window

Conversation

@cskiraly

Copy link
Copy Markdown

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.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant