forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edf: adding a construction option with a given number of pre-picks (e…
…nvoyproxy#31592) This is a follow up on envoyproxy#29953, with some insights about an additional scenario that has a similar problem. The EDF scheduler is used in 2 levels of Zone-Aware LB policies: 1. For choosing the locality to use (here for healthy hosts). Note that as opposed to the problem in (2), this also impacts equal-weighted localities. 2. For choosing the host within the chosen locality (here). Prior suggestions (WRSQ, envoyproxy#29953) focused on fixing level (2), and required converting the weights to integer-precision before performing the LB policy. While this may work for (2), assuming one can convert the weights to integers by multiplying by some factor and truncating, for (1) this approach is more challenging as when computing the "effective locality weight" its value is dependent on the over-provisioning factor and the ratio of available hosts to all hosts. An additional benefit is that the current approach can also work with slow-start. Thus, this PR suggests a different mechanism to "perform" some random number of picks when creating the EDF scheduler. The creation process is split into two steps: 1. Estimate a lower-bound on the number of picks each entry will be chosen, and initialize the internal EDF priority-queue accordingly. 2. Perform up to N "pickAndAdd" operations, where N is the number of localities/hosts. Note that this approach is ~equal to performing some P picks from the scheduler where P >> N (~equal up to double precision computation differences and entries order of entries with the same weight). After this PR, the next thing is to plumb the PRNG (or a random value) into the locality-scheduler creation process, and fix the call site for (1). Here's a short doc providing the rationale behind this work: https://docs.google.com/document/d/1i53RYOy8sJUwL6_PSIF4yN39Xc1LvJtZ-18aSBZq0vM/edit?usp=sharing Risk Level: low - code not used by Envoy's main codebase Testing: Added tests to validate equivalence with prior approach. Docs Changes: N/A Release Notes:N/A - will be updated when the Platform Specific Features: N/A Signed-off-by: Adi Suissa-Peleg <[email protected]>
- Loading branch information
Showing
3 changed files
with
303 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters