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
This commit is contained in:
David 2019-06-17 11:12:48 +02:00 committed by GitHub
parent bf55db4c7e
commit 20248c443b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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),
}
}
}

View File

@ -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),
},
};