-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bandwidth limiting #2035
Merged
Merged
Bandwidth limiting #2035
Conversation
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
update v17 upgrade path update v17 config tests
test to validate limiter
update nano::transport::channel::send to send if message shouldnt be dropped otherwise increment drop stat and dont send
…_req blocks use 1.5 * 1024 * 1024 for bytes to Mb limit
…data type and size include publish as it is vote traffic
…ging config option
cryptocode
suggested changes
May 28, 2019
convert to key before passing to now public detail_to_string
cryptocode
approved these changes
May 28, 2019
SergiySW
reviewed
May 29, 2019
wezrule
reviewed
May 30, 2019
wezrule
approved these changes
May 31, 2019
simplify limiter add bool not_dropable default false to nano::transport::channel::send allowing calls to channel::send to drop
wezrule
reviewed
Jun 3, 2019
clemahieu
reviewed
Jun 3, 2019
const limit as not changed after construction reverse send logic, default true adjust to exclude messages such as keepalives and bootstrap traffic
simplify bandwidth limiter
cryptocode
approved these changes
Jun 10, 2019
SergiySW
reviewed
Jun 10, 2019
SergiySW
reviewed
Jun 10, 2019
SergiySW
reviewed
Jun 10, 2019
argakiig
pushed a commit
that referenced
this pull request
Jun 11, 2019
* bandwidth_limit in bytes added to config update v17 upgrade path update v17 config tests * bandwidth limiter class test to validate limiter * hook to nano::transport::channel update nano::transport::channel::send to send if message shouldnt be dropped otherwise increment drop stat and dont send * initialize array with brace-enclosed initializer * correctly 1.5Mb * update tests to account for correct math and full confirm_ack confirm_req blocks use 1.5 * 1024 * 1024 for bytes to Mb limit * update config test * formatting * update default value in error text * add logging message and convenience detail_raw_to_string for dropped data type and size include publish as it is vote traffic * should always log dropped messages, this could be improved with a logging config option * stuff under logging;packet logging * typo and log out limit on node start * remove duplicate convert to key before passing to now public detail_to_string * Readability and simplification * use static constexpr in function * unsigned int < 0 always false * add republish_vote to could_drop * trend rate over minimum of 1 sec simplify limiter add bool not_dropable default false to nano::transport::channel::send allowing calls to channel::send to drop * update test to validate ramp down to 0 rate again * merge master * remove unused variables in tests const limit as not changed after construction reverse send logic, default true adjust to exclude messages such as keepalives and bootstrap traffic * clean up tests and add multiple limiters simplify bandwidth limiter * formatting * fix merge issues flip logic on is_dropable * allow dropping of keep alives * whitespace * use send instead of send_buffer a couple more places
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 purpose of this PR is to help ease resource usage by allowing a limit to be set on outbound bandwidth sent through transport::channel::send()
new config option
bandwidth_limit
with default of 1572864 bytes per secsetting
bandwidth_limit
to 0 will leave it unbounded which is the current behavioradd bool not_dropable default false to nano::transport::channel::send allowing calls to channel::send allow for dropping of traffic types if desired
collect rate for at least 50ms, sample into circular buffer trending over 20 samples to ramp up and down rate