Skip to content

local ratelimit: use new tokenbucket implementation#35207

Merged
wbpcode merged 3 commits into
envoyproxy:mainfrom
wbpcode:dev-local-ratelimit-tokenbucket
Jul 18, 2024
Merged

local ratelimit: use new tokenbucket implementation#35207
wbpcode merged 3 commits into
envoyproxy:mainfrom
wbpcode:dev-local-ratelimit-tokenbucket

Conversation

@wbpcode

@wbpcode wbpcode commented Jul 16, 2024

Copy link
Copy Markdown
Member

Commit Message: local ratelimit: use new tokenbucket implementation
Additional Description:

Part of #34774.

Updated the token bucket implementation to use non-timer based token bucket. The tokens will be refilled when the token bucket is accessed and no dependency on the timer.
This behavior can be temporarily reverted by setting the runtime guard envoy.reloadable_features.no_timer_based_rate_limit_token_bucket to false.

Risk Level: low.
Testing: unit.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.
[Optional Runtime guard:] envoy.reloadable_features.no_timer_based_rate_limit_token_bucket

Signed-off-by: wbpcode <wbphub@gmail.com>
@wbpcode wbpcode requested a review from mattklein123 as a code owner July 16, 2024 10:33
@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #35207 was opened by wbpcode.

see: more, trace.

mattklein123
mattklein123 previously approved these changes Jul 16, 2024
@wbpcode

wbpcode commented Jul 17, 2024

Copy link
Copy Markdown
Member Author

Hah, the listener local rate limit and network local rate limit.

@wbpcode

wbpcode commented Jul 17, 2024

Copy link
Copy Markdown
Member Author

image

The calculation of float/double number will result in a very very minor inaccuracy. This result in part of our unit tests failed. But I believe this inaccuracy won't effect our actual users because it's very very very minor.

Signed-off-by: wbpcode <wbphub@gmail.com>
@wbpcode

wbpcode commented Jul 17, 2024

Copy link
Copy Markdown
Member Author

/retest

@wbpcode wbpcode merged commit deaecaf into envoyproxy:main Jul 18, 2024
@wbpcode wbpcode deleted the dev-local-ratelimit-tokenbucket branch July 18, 2024 00:22
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.

2 participants