feat(grpc): add BBR-based adaptive rate limiting middleware for gRPC#1732
Merged
feat(grpc): add BBR-based adaptive rate limiting middleware for gRPC#1732
Conversation
Signed-off-by: Gaius <gaius.qi@gmail.com>
…ddleware Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
…ddleware Signed-off-by: Gaius <gaius.qi@gmail.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1732 +/- ##
==========================================
+ Coverage 46.53% 46.87% +0.33%
==========================================
Files 86 87 +1
Lines 24749 24811 +62
==========================================
+ Hits 11517 11629 +112
+ Misses 13232 13182 -50
🚀 New features to boost your workflow:
|
imeoer
approved these changes
Mar 17, 2026
EvanCley
approved these changes
Mar 17, 2026
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.
Description
This pull request introduces an adaptive rate limiting feature based on a BBR-inspired algorithm for gRPC download and upload servers, and synchronizes workspace dependencies across the project. The most important changes are the addition of the
BBRConfigand its integration into server configuration, implementation of the BBR middleware for gRPC, and updates to dependency versions for improved consistency and compatibility.Adaptive Rate Limiting for gRPC Servers
BBRConfigstruct for adaptive rate limiting configuration todragonfly-client-config/src/dfdaemon.rs, including default values and integration into theServerstruct and itsDefaultimplementation. This enables dynamic request shedding based on CPU and memory usage. [1] [2] [3]BBRConfigindragonfly-client-util/src/ratelimiter/bbr.rs, along with helper functions for default values. Added debug logging for cooldown periods. [1] [2] [3] [4]Middleware Integration
BBRLayer) into both download and upload gRPC servers (dragonfly-client/src/grpc/dfdaemon_download.rsanddragonfly-client/src/grpc/dfdaemon_upload.rs), including struct changes and service builder layering. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]Dependency Synchronization
Cargo.tomlfiles across the project to ensure consistency, including strict version pinning for several crates (e.g.,dragonfly-client,tonic,opentelemetry,tower,console-subscriber, etc.). [1] [2] [3] [4] [5] [6]Codebase Maintenance
dragonfly-client/src/grpc/manager.rsfor improved readability and import clarity.Related Issue
Motivation and Context
Screenshots (if appropriate)