-
Notifications
You must be signed in to change notification settings - Fork 265
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
Use a constant-time load balancer #266
Conversation
tower-rs/tower#288 changed the Balance implementation substantially so that it is no longer responsible for driving services to readiness. Instead, a new layer, `spawn_ready` is inserted around endpoint stack to ensure that readiness is driven on a background task. In support of this change, the `pending` layer was removed from the enpdoint stack and, instead, the discovery system is now responsible for driving pending services to be materialized.
Looks like CI is angry for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay for actually being constant-time! I'd love to see some benchmarks of the performance with the new balancer...
This branch looks mostly looks good. The one thing I was unsure about was the interaction between the FuturesUnordered
of pending services in Discover
and the processing of Remove
and NoEndpoints
updates --- it's a little bit hard to follow. I'm not currently sure what the correct behaviour is when we receive a removal update for a pending service...
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
…into ver/update-tower-balance
In doing so, I identified some raciness in the Discover implementation. Now, additions will cancel any previous make for that address; and we ensure that resolution is polled before the stream of pending services to accomodate for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes to the race conditions in the cancelation code look good --- thanks! This looks about ready to merge to me. I commented on some non-blocking nits.
Docker images pushed as |
|
I've also tried this without the spawn-ready layer for comparison. Throughput/latency is roughly the same, but spawn-ready does appear to reduce CPU utilization:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐ Makes sense to me
Each time we update the proxy from the linkerd2-proxy repo, we make the change slightly differently. The bin/update-proxy-version does all the steps needed to update the proxy version up to and including making a commit to this repo. The proxy version is now stored in a .proxy-version file and is consumed directly by Dockerfile-proxy, which both simplifies the Dockerfile and the update process. This script formats commit messages and emits output as follows: ``` commit c05198a851f69bdc7007974a0ef1f4c01c98d0ce (HEAD -> ver/proxy-update) Author: Oliver Gould <ver@buoyant.io> Date: Thu Jul 11 17:23:05 2019 +0000 proxy: Update to linkerd/linkerd2-proxy#3a3ec3b * linkerd/linker2-proxy#0cc58cd fallback: Clarify fallback layering (linkerd/linkerd2-proxy#288) * linkerd/linker2-proxy#b71349a Replace `log` and `env-logger` with `tracing` and `tracing-fmt` (linkerd/linkerd2-proxy#277) * linkerd/linker2-proxy#3a3ec3b Use a constant-time load balancer (linkerd/linkerd2-proxy#266) diff --git a/.proxy-version b/.proxy-version index f81f40de..d7faa12d 100644 --- a/.proxy-version +++ b/.proxy-version @@ -1 +1 @@ -05b012d +3a3ec3b ```
Each time we update the proxy from the linkerd2-proxy repo, we make the change slightly differently. The bin/git-commit-proxy-version does all the steps needed to update the proxy version up to and including making a commit to this repo. The proxy version is now stored in a .proxy-version file and is consumed directly by Dockerfile-proxy, which both simplifies the Dockerfile and the update process. This script formats commit messages and emits output as follows: ``` commit c05198a851f69bdc7007974a0ef1f4c01c98d0ce (HEAD -> ver/proxy-update) Author: Oliver Gould <ver@buoyant.io> Date: Thu Jul 11 17:23:05 2019 +0000 proxy: Update to linkerd/linkerd2-proxy#3a3ec3b * linkerd/linkerd2-proxy#0cc58cd fallback: Clarify fallback layering (linkerd/linkerd2-proxy#288) * linkerd/linkerd2-proxy#b71349a Replace `log` and `env-logger` with `tracing` and `tracing-fmt` (linkerd/linkerd2-proxy#277) * linkerd/linkerd2-proxy#3a3ec3b Use a constant-time load balancer (linkerd/linkerd2-proxy#266) diff --git a/.proxy-version b/.proxy-version index f81f40de..d7faa12d 100644 --- a/.proxy-version +++ b/.proxy-version @@ -1 +1 @@ -05b012d +3a3ec3b ```
* linkerd/linkerd2-proxy#0cc58cd fallback: Clarify fallback layering (linkerd/linkerd2-proxy#288) * linkerd/linkerd2-proxy#b71349a Replace `log` and `env-logger` with `tracing` and `tracing-fmt` (linkerd/linkerd2-proxy#277) * linkerd/linkerd2-proxy#3a3ec3b Use a constant-time load balancer (linkerd/linkerd2-proxy#266) * linkerd/linkerd2-proxy#f0ef775 Add `/proxy-log-level` endpoint to admin server (linkerd/linkerd2-proxy#279)
* fallback: Clarify fallback layering (linkerd/linkerd2-proxy#288) * Replace `log` and `env-logger` with `tracing` and `tracing-fmt` (linkerd/linkerd2-proxy#277) * Use a constant-time load balancer (linkerd/linkerd2-proxy#266) * Add `/proxy-log-level` endpoint to admin server (linkerd/linkerd2-proxy#279)
* fallback: Clarify fallback layering (linkerd/linkerd2-proxy#288) * Replace `log` and `env-logger` with `tracing` and `tracing-fmt` (linkerd/linkerd2-proxy#277) * Use a constant-time load balancer (linkerd/linkerd2-proxy#266) * Add `/proxy-log-level` endpoint to admin server (linkerd/linkerd2-proxy#279)
tower-rs/tower#288 changed the Balance implementation substantially so
that it is no longer responsible for driving services to readiness.
Instead, a new layer,
spawn_ready
is inserted around endpoint stack toensure that readiness is driven on a background task.
In support of this change, the
pending
layer was removed from theenpdoint stack and, instead, the discovery system is now responsible for
driving pending services to be materialized.