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.
nit: just initialize {true} here with the other initializers
There was a problem hiding this comment.
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.
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.
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.
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.
this should be precomputed. it can't change outside of the callback.
| }; | ||
|
|
||
| bool LoadBalancerBase::earlyExitNonZoneRouting() { | ||
| uint32_t number_of_zones = host_set_.healthyHostsPerZone().size(); |
| 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]; |
| } | ||
|
|
||
| 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.
nit: newline before this line
Signed-off-by: Kuat Yessenov <kuat@google.com>
标题: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 <mrebello@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
Update the docs to reflect new analyses following the libevent fixes from envoyproxy/envoy-mobile#215. Signed-off-by: Michael Rebello <mrebello@lyft.com> Signed-off-by: JP Simard <jp@jpsim.com>
* 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 <qiming.liu@intel.com> Signed-off-by: Huang Xin <xin1.huang@intel.com> Signed-off-by: Qiming Liu <qiming.liu@intel.com> Co-authored-by: Qiming <qiming.liu@intel.com>
No description provided.