Skip to content

perf: optimize zone aware load balancing#227

Merged
RomanDzhabarov merged 9 commits intomasterfrom
optimize_performance
Nov 17, 2016
Merged

perf: optimize zone aware load balancing#227
RomanDzhabarov merged 9 commits intomasterfrom
optimize_performance

Conversation

@RomanDzhabarov
Copy link
Copy Markdown
Member

No description provided.

const HostSet& host_set_;
const HostSet* local_host_set_;

bool early_exit_zone_routing_;
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

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() {
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member Author

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);
Copy link
Copy Markdown
Member

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) {
Copy link
Copy Markdown
Member

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();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local var not needed

Copy link
Copy Markdown
Member Author

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];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local var not needed

Copy link
Copy Markdown
Member Author

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.
Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg after nit

@RomanDzhabarov RomanDzhabarov merged commit bb93ab7 into master Nov 17, 2016
@RomanDzhabarov RomanDzhabarov deleted the optimize_performance branch November 17, 2016 02:23
liuxu623 pushed a commit to liuxu623/envoy that referenced this pull request Jul 14, 2020
Signed-off-by: Kuat Yessenov <kuat@google.com>
wolfguoliang pushed a commit to wolfguoliang/envoy that referenced this pull request Jan 23, 2021
标题:zh-translation: docs/root/intro/arch_overview/observability/access_logging.rst
jpsim pushed a commit that referenced this pull request Nov 28, 2022
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>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
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>
soulxu pushed a commit to soulxu/envoy that referenced this pull request Feb 27, 2024
* 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>
arminabf pushed a commit to arminabf/envoy that referenced this pull request Jun 5, 2024
mathetake added a commit that referenced this pull request Mar 3, 2026
**Commit Message**:

This was necessary before #219 and #224 landed
the main branch. Now the secret updates will be 
automatically picked up by the extproc without restarts.
This behavior is already being tested in an e2e test.

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants