-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
crates/node-builder/src/builder.rs
Outdated
ThreadPoolBuilder::new() | ||
.num_threads( | ||
available_parallelism().map_or(25, |cpus| max(cpus.get().saturating_sub(2), 2)), | ||
) | ||
.build_global()?; |
There was a problem hiding this comment.
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
There was a problem hiding this 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
There was a problem hiding this 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
Configures the global rayon pool to
available_parallelism() - 2
, making sure we don't starve other jobs when doing heavy prolongued workref #6888