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

fix: configure global rayon pool to available_parallelism() - 2 #7267

Merged
merged 3 commits into from
Mar 21, 2024

Conversation

joshieDo
Copy link
Collaborator

Configures the global rayon pool to available_parallelism() - 2, making sure we don't starve other jobs when doing heavy prolongued work

ref #6888

@joshieDo joshieDo added C-bug An unexpected or incorrect behavior C-perf A change motivated by improving speed, memory usage or disk footprint labels Mar 21, 2024
@joshieDo joshieDo requested a review from mattsse March 21, 2024 11:50
@joshieDo joshieDo requested a review from gakonst as a code owner March 21, 2024 11:50
Comment on lines 445 to 449
ThreadPoolBuilder::new()
.num_threads(
available_parallelism().map_or(25, |cpus| max(cpus.get().saturating_sub(2), 2)),
)
.build_global()?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we ignore the error here and log it instead?
in case the user already configured this

@joshieDo joshieDo requested a review from mattsse March 21, 2024 12:20
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm, pending @rkrasiuk

this should not have any effect on state root related tasks but is a simple solution for #6888

I think another solution we should explore is not using for any io at all in the sender recovery stage when in rayon context, but this needs more benchmarking effort, so this should be a quick fix for #6888 and any other stage that utilizes rayon for a long time

Copy link
Member

@rkrasiuk rkrasiuk left a comment

Choose a reason for hiding this comment

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

sgtm as well, let's see if it fixes the current issues

@joshieDo joshieDo added this pull request to the merge queue Mar 21, 2024
Merged via the queue into main with commit aac0b00 Mar 21, 2024
28 checks passed
@joshieDo joshieDo deleted the joshie/rayon-global branch March 21, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug An unexpected or incorrect behavior C-perf A change motivated by improving speed, memory usage or disk footprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants