Skip to content
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

trace: update tracing-subscriber dependency to 0.2.1 #426

Merged
merged 1 commit into from Feb 17, 2020

Conversation

hawkw
Copy link
Member

@hawkw hawkw commented Feb 14, 2020

This release makes a number of significant performance improvements when
filtering events emitted through the log compatibility layer (such as
from hyper and h2). See tokio-rs/tracing#586 for details.

Since these performance improvements apply to cases where a filter
disables an event, as well as to enabling events, this should improve
the proxy's performance with the default log configuration, especially
given that h2 and hyper emit a lot of trace-level logs in hot
paths. Ignoring those logs should now have a much lower overhead.

In addition, 0.2.1 fixes a bug where EnvFilter's filter selection
differed from the env_logger behavior it was intended to emulate. If
the most specific filter directive that applies to a given event did not
enable that event's level, filter selection would continue to try
decreasingly-specific filters, and would only disable the event if
no filters enabled it (see tokio-rs/tracing#512).

In practice, this means that if you set a filter like

LINKERD2_PROXY_LOG=warn,linkerd=debug,linkerd2_metrics=info

in an attempt to disable the debug-level events in the
linkerd2_metrics crate, they would still be enabled by the
linkerd=debug directive.

This is now fixed.

Signed-off-by: Eliza Weisman eliza@buoyant.io

This release makes a number of significant performance improvements when
filtering events emitted through the `log` compatibility layer (such as
from `hyper` and `h2`). See tokio-rs/tracing#586 for details.

Since these performance improvements apply to cases where a filter
_disables_ an event, as well as to enabling events, this should improve
the proxy's performance with the default log configuration, especially
given that `h2` and `hyper` emit a _lot_ of `trace`-level logs in hot
paths. Ignoring those logs should now have a much lower overhead.

I'm going to do some benchmarking to quantify the performance
improvement from this change, so I'll add benchmark results when my
tests complete.

In addition, 0.2.1 fixes a bug where `EnvFilter`'s filter selection
differed from the `env_logger` behavior it was intended to emulate. If
the most specific filter directive that applies to a given event did not
enable that  event's level, filter selection would continue to try
decreasingly-specific filters, and would only disable the event if
**no** filters enabled it (see tokio-rs/tracing#512).

In practice, this means that if you set a filter like

```
LINKERD2_PROXY_LOG=warn,linkerd=debug,linkerd2_metrics=info
```

in an attempt to disable the `debug`-level events in the
`linkerd2_metrics` crate, they would still be enabled by the
`linkerd=debug` directive.

This is now fixed.

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
@hawkw hawkw marked this pull request as ready for review February 15, 2020 00:15
@hawkw
Copy link
Member Author

hawkw commented Feb 15, 2020

preliminary latency benchmarks:
master-vs-subscriber-0_2_1latency
although, these were both run with LINKERD2_PROXY_LOG="", and we might see a bigger difference with more filters.

@olix0r olix0r requested a review from a team February 17, 2020 18:08
@olix0r olix0r merged commit 4534327 into master Feb 17, 2020
@olix0r olix0r deleted the eliza/subscriber-0.2.1 branch February 17, 2020 18:09
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Feb 19, 2020
This release includes the results from continued profiling & performance
analysis. In addition to modifying internals to prevent unwarranted
memory growth, we've introduced new metrics to aid in debugging and
diagnostics: a new `request_errors_total` metric exposes the number of
requests that receive synthesized responses due to proxy errors; and a
suite of `stack_*` metrics expose proxy internals that can help us
identify unexpected behavior.

---

* trace: update `tracing-subscriber` dependency to 0.2.1 (linkerd/linkerd2-proxy#426)
* Reimplement the Lock middleware with tokio::sync (linkerd/linkerd2-proxy#427)
* Add the request_errors_total metric (linkerd/linkerd2-proxy#417)
* Expose the number of service instances in the proxy (linkerd/linkerd2-proxy#428)
* concurrency-limit: Share a limit across Services (linkerd/linkerd2-proxy#429)
* profiling: add benchmark and profiling scripts (linkerd/linkerd2-proxy#406)
* http-box: Box HTTP payloads via middleware (linkerd/linkerd2-proxy#430)
* lock: Generalize to protect a guarded value (linkerd/linkerd2-proxy#431)
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Feb 19, 2020
This release includes the results from continued profiling & performance
analysis. In addition to modifying internals to prevent unwarranted
memory growth, we've introduced new metrics to aid in debugging and
diagnostics: a new `request_errors_total` metric exposes the number of
requests that receive synthesized responses due to proxy errors; and a
suite of `stack_*` metrics expose proxy internals that can help us
identify unexpected behavior.

---

* trace: update `tracing-subscriber` dependency to 0.2.1 (linkerd/linkerd2-proxy#426)
* Reimplement the Lock middleware with tokio::sync (linkerd/linkerd2-proxy#427)
* Add the request_errors_total metric (linkerd/linkerd2-proxy#417)
* Expose the number of service instances in the proxy (linkerd/linkerd2-proxy#428)
* concurrency-limit: Share a limit across Services (linkerd/linkerd2-proxy#429)
* profiling: add benchmark and profiling scripts (linkerd/linkerd2-proxy#406)
* http-box: Box HTTP payloads via middleware (linkerd/linkerd2-proxy#430)
* lock: Generalize to protect a guarded value (linkerd/linkerd2-proxy#431)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants