mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
mononoke: use logical number of cpus in our runtime
Summary: We are using older version of tokio which spawns as many threads as we have physical cores instead of the number of logical cores. It was fixed in https://github.com/tokio-rs/tokio/issues/2269 but we can't use it yet because we are waiting for another fix to be released - https://github.com/rust-lang/futures-rs/pull/2154. For now let's hardcode it in mononoke Reviewed By: krallin Differential Revision: D23599140 fbshipit-source-id: 80685651a7a29ba8938d9aa59770f191f7c42b8b
This commit is contained in:
parent
f87db3eecf
commit
b5f1e53cd6
@ -42,6 +42,7 @@ lazy_static = "1.0"
|
||||
libc = "0.2"
|
||||
log = { version = "0.4.8", features = ["kv_unstable"] }
|
||||
maplit = "1.0"
|
||||
num_cpus = "1.11"
|
||||
serde = { version = "1.0", features = ["derive", "rc"] }
|
||||
slog = { version = "2.5", features = ["max_level_debug"] }
|
||||
slog-term = "2.4.2"
|
||||
|
@ -162,6 +162,10 @@ pub fn create_runtime(
|
||||
builder.name_prefix(log_thread_name_prefix.unwrap_or("tk"));
|
||||
if let Some(core_threads) = core_threads {
|
||||
builder.core_threads(core_threads);
|
||||
} else {
|
||||
// TODO(stash) T75113443 remove when
|
||||
// https://github.com/tokio-rs/tokio/issues/2269 is landed
|
||||
builder.core_threads(num_cpus::get());
|
||||
}
|
||||
builder.build()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user