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

feat(server): Use a single tokio runtime, adjust processor task count #3516

Merged
merged 4 commits into from
May 6, 2024

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented May 2, 2024

As described in #3513.

  • Removes all additional secondary runtimes for individual services.
  • Adjusts the thread count for the processor to not use all resources given.

Will be followed by an ops PR to adjust configuration settings.

@Dav1dde Dav1dde requested a review from a team as a code owner May 2, 2024 14:20
@Dav1dde Dav1dde requested a review from jan-auer May 2, 2024 14:20
@Dav1dde Dav1dde force-pushed the dav1d/remove-runtimes branch 2 times, most recently from bedbba1 to bf1ed87 Compare May 2, 2024 14:21
@Dav1dde Dav1dde force-pushed the dav1d/remove-runtimes branch from bf1ed87 to 8c3d622 Compare May 2, 2024 15:53
Copy link
Member

@jjbayer jjbayer left a comment

Choose a reason for hiding this comment

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

Code looks good to me but I'm nervous about shipping this. Should we run it on the load tester first? Or let it sit on Canary for a week before we deploy it to all pods?

@Dav1dde Dav1dde self-assigned this May 3, 2024
@Dav1dde
Copy link
Member Author

Dav1dde commented May 3, 2024

We can, but I don't see this as risky and would have moved on from canary and S4S after a workday.

@@ -586,7 +586,7 @@ struct Limits {
max_replay_message_size: ByteSize,
/// The maximum number of threads to spawn for CPU and web work, each.
///
/// The total number of threads spawned will roughly be `2 * max_thread_count + 1`. Defaults to
/// The total number of threads spawned will roughly be `2 * max_thread_count`. Defaults to
Copy link
Member

Choose a reason for hiding this comment

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

Can we add to this comment that Relay will use at most max_thread_count CPU?

Copy link
Member Author

Choose a reason for hiding this comment

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

With the current setup this isn't gurantueed right? If the runtime needs more processing power than expected it can go over.

Comment on lines 2633 to 2636
0 | 1 => 1,
2 | 3 => 2,
4 => 3,
conc => conc - 2,
Copy link
Member

Choose a reason for hiding this comment

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

Have you run load tests with this? It would be good to know the actual needs here, if this is easy to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

No, this was simply a best effort guess for small amounts of cores going off our discussed -2 starting point.

Having a small amount of cores would reserve a much bigger % to the runtime than if we have a large amount of cores. E.g. for 2 cores allocating 1 thread to the processor would allocate 50% to the runtime, while having 12 cores only allocates 17% to the runtime.

relay-server/src/services/processor.rs Outdated Show resolved Hide resolved
@Dav1dde Dav1dde merged commit 275e60e into master May 6, 2024
22 checks passed
@Dav1dde Dav1dde deleted the dav1d/remove-runtimes branch May 6, 2024 15:07
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