LoadBalancer: Skip EdfScheduler creation in LoadBalancerBase if all host weights are equal.#7877
Merged
mattklein123 merged 14 commits intoenvoyproxy:masterfrom Aug 15, 2019
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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