From 34161455741d2258a8ecba7647c111e341618c5a Mon Sep 17 00:00:00 2001 From: Federico Gimenez Date: Fri, 20 Sep 2024 19:56:46 +0200 Subject: [PATCH] perf: increase threads in global pool (#11075) --- crates/node/builder/src/launch/common.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/node/builder/src/launch/common.rs b/crates/node/builder/src/launch/common.rs index f9974711b7df..27b4eb90be3a 100644 --- a/crates/node/builder/src/launch/common.rs +++ b/crates/node/builder/src/launch/common.rs @@ -180,10 +180,10 @@ impl LaunchContext { Err(err) => warn!(%err, "Failed to raise file descriptor limit"), } - // Limit the global rayon thread pool, reserving 2 cores for the rest of the system. - // If the system has less than 2 cores, it will use 1 core. + // Limit the global rayon thread pool, reserving 1 core for the rest of the system. + // If the system only has 1 core the pool will use it. let num_threads = - available_parallelism().map_or(0, |num| num.get().saturating_sub(2).max(1)); + available_parallelism().map_or(0, |num| num.get().saturating_sub(1).max(1)); if let Err(err) = ThreadPoolBuilder::new() .num_threads(num_threads) .thread_name(|i| format!("reth-rayon-{i}"))