Skip to content

LoadBalancer: Skip EdfScheduler creation in LoadBalancerBase if all host weights are equal.#7877

Merged
mattklein123 merged 14 commits intoenvoyproxy:masterfrom
antoniovicente:no_edf_if_weights_equal
Aug 15, 2019
Merged

LoadBalancer: Skip EdfScheduler creation in LoadBalancerBase if all host weights are equal.#7877
mattklein123 merged 14 commits intoenvoyproxy:masterfrom
antoniovicente:no_edf_if_weights_equal

Conversation

@antoniovicente
Copy link
Copy Markdown
Contributor

Description: Only create EdfScheduler for round-robing and least-request load balancers if hosts have different weights. This reduces CPU usage during load balancer creation and memory usage in the common case where all hosts have the same weight. Also, extend load_balancer_benchmark to show memory savings in cases where all weights are equal. Partial benchmark results per RoundRobin LB instance per serving thread:
25,000 hosts
weighted %: 0 CPU time: 34.4ms memory: 1.408KB
weighted %: 50 CPU time: 53.5ms memory: 3.14728MB
weighted %: 100 CPU time: 34.5ms memory: 1.408KB
50,000 hosts
weighted %: 0 CPU time: 68.2ms memory: 1.408k
weighted %: 50 CPU time: 103ms memory: 6.29301M
weighted %: 100 CPU time: 68.5ms memory: 1.408k
In addition to memory reductions, least-request load balancers with equal weights will now use P2C for host selection instead of edf with adjusted weights.

Risk Level: Medium. Minor changes to the behavior of least-requests load balancer.
Testing: unittest
Docs Changes: fixed existing docs
Release Notes: Added
Issue #3790, #3278

Loading
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.

3 participants