From 782968d2a891d7c00566c6ad1f01c44c9b0f519e Mon Sep 17 00:00:00 2001 From: David Palm Date: Fri, 14 Jun 2019 22:11:45 +0200 Subject: [PATCH 1/2] Use fewer threads for snapshotting When taking a snapshot the current default number of threads is equal to half the number of **logical** CPUs in the system. On HT enabled CPUs this value seems a bit high, e.g. 6 snapshotting threads on a 6/12 core/hyperthread CPU. Maybe a better default value is half the number of physical cores? --- ethcore/src/snapshot/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/snapshot/mod.rs b/ethcore/src/snapshot/mod.rs index 155182ed516..7f6a365d99d 100644 --- a/ethcore/src/snapshot/mod.rs +++ b/ethcore/src/snapshot/mod.rs @@ -107,7 +107,7 @@ impl Default for SnapshotConfiguration { fn default() -> Self { SnapshotConfiguration { no_periodic: false, - processing_threads: ::std::cmp::max(1, num_cpus::get() / 2), + processing_threads: ::std::cmp::max(1, num_cpus::get_physical() / 2), } } } From 8eb5928032b301e31866bc7b80915262812d6b9d Mon Sep 17 00:00:00 2001 From: David Palm Date: Mon, 17 Jun 2019 08:40:04 +0200 Subject: [PATCH 2/2] fix test --- parity/configuration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parity/configuration.rs b/parity/configuration.rs index 28bc08c903b..3996fa6cafe 100644 --- a/parity/configuration.rs +++ b/parity/configuration.rs @@ -934,7 +934,7 @@ impl Configuration { no_periodic: self.args.flag_no_periodic_snapshot, processing_threads: match self.args.arg_snapshot_threads { Some(threads) if threads > 0 => threads, - _ => ::std::cmp::max(1, num_cpus::get() / 2), + _ => ::std::cmp::max(1, num_cpus::get_physical() / 2), }, };