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.
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
server: add support for range trigger overload actions #12352
server: add support for range trigger overload actions #12352
Changes from 2 commits
cab9e1f
864ab5e
accf2e3
981ff10
ecad37b
d1f482c
8dd5584
622d9da
bf77119
77c2187
4f9426e
6d6fcf9
ad0b0ab
7a4578c
4de8f83
264a753
d0acf25
111f31d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the function on L23 seems to imply that we refer to value = 0 as
inactive
, is this a useful distinction to make? Should that be included in this comment?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am planning to handle this in a follow-up PR. It does seem like a useful distinction at least conceptually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because then OverloadActionState isn't assignable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can you adjust this exception message to match the field names? I.e. scaling/saturated_threshold.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is additional work needed to optimize update propagation? It seems that each action is propagated independently to workers. updateResourcePressure returns true a lot more often than before. Is there some potential for aggregation?
How often does updateResourcePressure run anyway? Should the code below wait for propagation to complete before returning as a way to ensure that at most 1 update is in progress?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I think it should be straightforward to aggregate a bunch of <action, state> pairs in this loop and then send them to workers with a single call to runOnAllThreads. Maybe best to do this in a follow-on PR?
Re: how often this is called - our best practices doc for use as an edge proxy has an example config where we set this to 250ms (https://www.envoyproxy.io/docs/envoy/latest/configuration/best_practices/edge)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think there are a couple optimizations we can apply here. Right now we post an event to each worker for each resource update, but we can do a better job of coalescing those. updateResourcePressure returns true more often only if the proxy is configured with a range trigger, which none should be yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to address this an Elisha's other comment about the 'inactive' state in a follow-on PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is some logging appropriate for scaling state transitions?
Possibly LOG_EVERY_N_SEC when scaling, and/or LOG when entering and exiting scaling mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably a good idea. Does Envoy have a LOG_EVERY_N_SEC macro?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem like it. At least not yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also be at
debug
level I think.