Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ref(server): Run processor threads with lower priority #4222

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

Dav1dde
Copy link
Member

@Dav1dde Dav1dde commented Nov 5, 2024

The original plan was to also set the scheduler priority to SCHED_BATCH (man sched(7)) but while looking for other projects I found Apache Arrow Fusion which also sets their priority for a CPU bound worker pool: https://github.com/msathis/arrow-datafusion/blob/bb646802001ffbb1cc35679eea0ded86dd769a8d/ballista/rust/executor/src/cpu_bound_executor.rs#L58-L59

As well as a referenced blog article: https://thenewstack.io/using-rustlangs-async-tokio-runtime-for-cpu-bound-tasks/

Convincing me that this is in fact a good idea as well as dropping the idea of messing with scheduler priorities, which in testing also seems to be very finicky to get right.

The change is supposed to have a positive effect on tail latencies for all tasks scheduled on the Tokio runtime as well as prioritizing these tasks when under pressure.

@Dav1dde Dav1dde requested a review from a team as a code owner November 5, 2024 15:35
@Dav1dde Dav1dde self-assigned this Nov 5, 2024
@Dav1dde Dav1dde merged commit 71ebf8a into master Nov 6, 2024
23 checks passed
@Dav1dde Dav1dde deleted the dav1d/worker-thread-priot branch November 6, 2024 11:57
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants