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

Add multicore to default features #612

Merged
merged 2 commits into from
Jul 31, 2020
Merged

Add multicore to default features #612

merged 2 commits into from
Jul 31, 2020

Conversation

olix0r
Copy link
Member

@olix0r olix0r commented Jul 31, 2020

We don't have any blockers to using the threaded runtime by default.
This change adds the multicore feature flag to the default feature
list.

It also modifies the threaded runtime initialization to use all
available cores.

The thread names have been changed from linkerd2-proxy-worker to just
proxy, which is more consistent with the admin thread name. This
should be unambiguous in the context of the process.

We don't have any blockers to using the threaded runtime by default.
This change adds the `multicore` feature flag to the default feature
list.

It also modifies the threaded runtime initialization to use all
available cores.

The thread names have been changed from `linkerd2-proxy-worker` to just
`proxy`, which is more consistent with the `admin` thread name. This
should be unambiguous in the context of the process.
@olix0r olix0r requested a review from a team July 31, 2020 05:59

#[cfg(feature = "multicore")]
pub(crate) fn build() -> Runtime {
let builder = runtime::Builder::new()
.enable_all()
.thread_name("linkerd2-proxy-worker");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaict this didn't actually compile this way

Copy link
Contributor

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple of nits, LGTM otherwise.

Comment on lines +5 to +7
// The proxy creates an additional admin thread, but it would be wasteful to allocate a whole
// core to it; so we let the main runtime consume all cores the process has. The basic scheduler
// is used when the threaded scheduler would provide no benefit.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

linkerd2-proxy/src/rt.rs Outdated Show resolved Hide resolved
linkerd2-proxy/src/rt.rs Show resolved Hide resolved
Copy link
Contributor

@kleimkuhler kleimkuhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@olix0r
Copy link
Member Author

olix0r commented Jul 31, 2020

image

Pin max_threads to core_threads.

Fixup panic message

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
@olix0r olix0r merged commit c234a92 into main Jul 31, 2020
@olix0r olix0r deleted the ver/multicore-tweaks branch July 31, 2020 19:57
olix0r added a commit to linkerd/linkerd2 that referenced this pull request Aug 5, 2020
This release enables a multi-threaded runtime. Previously, the proxy
would only ever use a single thread for data plane processing; now, when
the proxy is allocated more than 1 CPU share, the proxy allocates a
thread per available CPU. This has shown substantial latency
improvements in benchmarks, especially when the proxy is serving
requests for many concurrent connections.

---

* Add a `multicore` feature flag (linkerd/linkerd2-proxy#611)
* Add `multicore` to default features (linkerd/linkerd2-proxy#612)
* admin: add an endpoint to dump spawned Tokio tasks (linkerd/linkerd2-proxy#595)
* trace: roll `tracing` and `tracing-subscriber` dependencies (linkerd/linkerd2-proxy#615)
* stack: Add NewService::into_make_service (linkerd/linkerd2-proxy#618)
* trace: tweak tracing & test support for the multithreaded runtime (linkerd/linkerd2-proxy#616)
* Make FailFast cloneable (linkerd/linkerd2-proxy#617)
* Move HTTP detection & server into linkerd2_proxy_http (linkerd/linkerd2-proxy#619)
* Mark tap integration tests as flakey (linkerd/linkerd2-proxy#621)
* Introduce a SkipDetect layer to preempt detection (linkerd/linkerd2-proxy#620)
adleong pushed a commit to linkerd/linkerd2 that referenced this pull request Aug 6, 2020
This release enables a multi-threaded runtime. Previously, the proxy
would only ever use a single thread for data plane processing; now, when
the proxy is allocated more than 1 CPU share, the proxy allocates a
thread per available CPU. This has shown substantial latency
improvements in benchmarks, especially when the proxy is serving
requests for many concurrent connections.

---

* Add a `multicore` feature flag (linkerd/linkerd2-proxy#611)
* Add `multicore` to default features (linkerd/linkerd2-proxy#612)
* admin: add an endpoint to dump spawned Tokio tasks (linkerd/linkerd2-proxy#595)
* trace: roll `tracing` and `tracing-subscriber` dependencies (linkerd/linkerd2-proxy#615)
* stack: Add NewService::into_make_service (linkerd/linkerd2-proxy#618)
* trace: tweak tracing & test support for the multithreaded runtime (linkerd/linkerd2-proxy#616)
* Make FailFast cloneable (linkerd/linkerd2-proxy#617)
* Move HTTP detection & server into linkerd2_proxy_http (linkerd/linkerd2-proxy#619)
* Mark tap integration tests as flakey (linkerd/linkerd2-proxy#621)
* Introduce a SkipDetect layer to preempt detection (linkerd/linkerd2-proxy#620)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants