rt: don't reserve a core for the admin runtime admin #613
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As per @olix0r in #611 (comment):
The admin runtime only performs observability work & certifies
identitities, so its load should be pretty light, and it doesn't need to
be actively using a CPU core all the time. The purpose of having a
separate admin runtime is to continue allowing access to observability
functions even if the rest of the proxy gets into a bad state, not to
take load off the main forwarding runtime; the admin thread no longer
performs service discovery lookups (and I think it hasn't for a while).
This branch changes the
rt::build
function inlinkerd2-proxy
sothat, when the multithreaded Tokio runtime feature is enabled, we give
the main forwarding runtime a thread for every available CPU core,
rather than every core minus one. Furthermore, if the feature flag is
enabled, we will now use the multithreaded Tokio scheduler if the
number of available CPUs is two or more, rather than three or more,
since we are no longer reserving a thread for the admin runtime.
In order to ensure that the admin runtime is out of the forwarding
path (so that multiple worker threads don't result in a corresponding
increase in admin load), I've moved the DNS resolver background task to
the main runtime. As a potential follow-up, we might want to simplify
the DNS code so that we just spawn resolution tasks directly, rather
than having a DNS daemon task.
trust-dns
no longer requires abackground task, so its purpose was just to ensure that DNS resolutions
were spawned on the admin thread.