-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EWMA score adjusted by success rate when backend services fail fast #9882
base: main
Are you sure you want to change the base?
Conversation
|
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Welcome @jizhuozhi! |
Hi @jizhuozhi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
@jizhuozhi the lua tests failed, you can check the prow job logs for the reasons. /hold |
Thanks, I will check the failed jobs and fix them |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jizhuozhi The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hello, @strongjz , failed tests are fixed, PLAT 😺 |
Hello, @strongjz @tao12345666333 , PTAL, thanks |
/assign |
What this PR does / why we need it:
PeakEWMA (or EWMA) is a latency-based load balancing algorithm. Latency-based load balancing algorithms are all based on the premise that the cost of processing requests is the same. But as we all know, user input is untrustworthy, and all backend services will verify user (or other service) input, and once the verification fails, the request will not be processed and the result will be returned quickly, which will lead to The load balancing algorithm gets a wrong view: this request is processed very quickly.
The same problem is also described in "The Site Reliability Workbook: Practical Ways to Implement SRE". When the resource-based load balancing algorithm encounters fail-fast, traffic will skew to the abnormal server.
We need a mathematical model to fix this wrong view. The easiest ways to do this is to fix all response times to the same value as the
SuccessDuration
Why use EWMA to count the failure rate instead of the arithmetic mean:
The number of long-running service samples will continue to increase. The longer the running time, the harder it is to detect short-term failures. At the same time, because the traffic distribution will be reduced after the failure is detected, it will take a long time to recover enough samples. And through EWMA, it can automatically decay to a small enough value over time
Types of changes
Which issue/s this PR fixes
How Has This Been Tested?
All effects are limited to ewma load balancer, so I only added test cases for EWMA. I mocked the failed response and tested for changes in the EWMA value.
Checklist:
Does my pull request need a release note?
Any user-visible or operator-visible change qualifies for a release note. This could be a:
No release notes are required for changes to the following:
For more tips on writing good release notes, check out the Release Notes Handbook