ref(server): Move all heavy actors into dedicated arbiters #1378
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.
Each actix arbiter spawns a thread with its own single-threaded event loop. This
allows to create isolation between actors that may cause CPU spikes when
backlogged, and makes fair scheduling in actix easier.
While some of our actors, notably the
OutcomeProducer
and (metrics)Aggregator
had been spawned into a dedicated arbiter, most of the other actorswere still running on the main arbiter. The
EnvelopeManager
is known to causean increase in CPU consumption due to how it spawns futures internally. This
slows down the project cache and healthcheck, which in turn blocks incoming HTTP
requests.
Since there's a global slowdown of the main arbiter, it becomes hard to separate
cause from effect when investigating slow response times. It is not clear
whether the project cache causes increased queue sizes or whether increased
queue sizes delay project fetching.
To create clear separation, this PR introduces a dedicated arbiter for every
heavy actor.