-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
perf: optimize zone aware load balancing #227
Conversation
const HostSet& host_set_; | ||
const HostSet* local_host_set_; | ||
|
||
bool early_exit_zone_routing_; |
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: just initialize {true} here with the other initializers
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.
Actually, early_exit_zone_routing_ and route_directly_ are mutually exclusive. Combine these into a state_ enum which has something like [NoZoneRouting, ZoneDirect, ZoneResidual] or something. You can have cleaner logic and better asserts this way.
} | ||
}; | ||
|
||
bool LoadBalancerBase::earlyExitNonZoneRoutingRuntime() { |
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 would get rid of this function. Everything in here can either be done ahead of time (min cluster size, etc.) or can be moved into the tryChooseLocalZoneHosts() function
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'll move runtime checks into tryChooseLocalZoneHosts(), we need access runtime values on each iteration if we are not in NoZoneRouting
return host_set_.healthyHosts(); | ||
} | ||
|
||
ASSERT(local_host_set_ != nullptr); |
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: remove assert will just crash on next line
|
||
// Do not perform zone routing for small clusters. | ||
uint64_t min_cluster_size = runtime_.snapshot().getInteger(RuntimeMinClusterSize, 6U); | ||
if (host_set_.healthyHosts().size() < min_cluster_size) { |
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 be precomputed. it can't change outside of the callback.
}; | ||
|
||
bool LoadBalancerBase::earlyExitNonZoneRouting() { | ||
uint32_t number_of_zones = host_set_.healthyHostsPerZone().size(); |
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.
local var not needed
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.
removed
if (local_host_set_ == nullptr || local_host_set_->hosts().empty() || | ||
isGlobalPanic(*local_host_set_)) { | ||
stats_.lb_local_cluster_not_ok_.inc(); | ||
const std::vector<HostPtr>& local_zone_healthy_hosts = host_set_.healthyHostsPerZone()[0]; |
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.
local var not needed
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.
fixed.
} | ||
|
||
zone_routing_state_ = ZoneRoutingState::ZoneResidual; | ||
// If we cannot route all requests to the same zone, calculate what percentage can be routed. |
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: newline before this line
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.
lg after nit
Signed-off-by: Kuat Yessenov <[email protected]>
标题:zh-translation: docs/root/intro/arch_overview/observability/access_logging.rst
Update the docs to reflect new analyses following the libevent fixes from envoyproxy/envoy-mobile#215. Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
Update the docs to reflect new analyses following the libevent fixes from envoyproxy/envoy-mobile#215. Signed-off-by: Michael Rebello <[email protected]> Signed-off-by: JP Simard <[email protected]>
* Add SGX private key provider and fuzz tests (envoyproxy#227) * Add fuzz test for sgx private key protection (envoyproxy#151) * Fix factory_context issues. * Fix fallback method in sgx private_key_provider. * temporarily disable sgx fuzz testing * Fix duplicate udpa symbols. Signed-off-by: Liu, Qiming <[email protected]> Signed-off-by: Huang Xin <[email protected]> Signed-off-by: Qiming Liu <[email protected]> Co-authored-by: Qiming <[email protected]>
No description provided.