Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 20248c4

Browse files
authored
Use fewer threads for snapshotting (#10752)
* 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? * fix test
1 parent bf55db4 commit 20248c4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ethcore/src/snapshot/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl Default for SnapshotConfiguration {
107107
fn default() -> Self {
108108
SnapshotConfiguration {
109109
no_periodic: false,
110-
processing_threads: ::std::cmp::max(1, num_cpus::get() / 2),
110+
processing_threads: ::std::cmp::max(1, num_cpus::get_physical() / 2),
111111
}
112112
}
113113
}

parity/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ impl Configuration {
934934
no_periodic: self.args.flag_no_periodic_snapshot,
935935
processing_threads: match self.args.arg_snapshot_threads {
936936
Some(threads) if threads > 0 => threads,
937-
_ => ::std::cmp::max(1, num_cpus::get() / 2),
937+
_ => ::std::cmp::max(1, num_cpus::get_physical() / 2),
938938
},
939939
};
940940

0 commit comments

Comments
 (0)