From 38c7e5005ece5d05127b5b426b6e3eef267b464a Mon Sep 17 00:00:00 2001 From: luofucong Date: Mon, 3 Jun 2024 19:45:34 +0800 Subject: [PATCH] fix: resolve PR comments --- Cargo.lock | 5 +++-- src/common/runtime/src/global.rs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35fabee98b6c..49faee6a6569 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2074,9 +2074,11 @@ dependencies = [ "common-macro", "common-telemetry", "lazy_static", + "num_cpus", "once_cell", "paste", "prometheus", + "serde", "snafu 0.8.3", "tokio", "tokio-metrics", @@ -11031,8 +11033,7 @@ dependencies = [ [[package]] name = "tokio-metrics-collector" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767da47381602cc481653456823b3ebb600e83d5dd4e0293da9b5566c6c00f0" +source = "git+https://github.com/MichaelScofield/tokio-metrics-collector.git?rev=89d692d5753d28564a7aac73c6ac5aba22243ba0#89d692d5753d28564a7aac73c6ac5aba22243ba0" dependencies = [ "lazy_static", "parking_lot 0.12.3", diff --git a/src/common/runtime/src/global.rs b/src/common/runtime/src/global.rs index 9a6c358b2510..6b21851e1680 100644 --- a/src/common/runtime/src/global.rs +++ b/src/common/runtime/src/global.rs @@ -40,11 +40,11 @@ pub struct RuntimeOptions { impl Default for RuntimeOptions { fn default() -> Self { - let two_fold_cpus = num_cpus::get() * 2; + let cpus = num_cpus::get(); Self { - read_rt_size: two_fold_cpus, - write_rt_size: two_fold_cpus, - bg_rt_size: two_fold_cpus, + read_rt_size: cpus, + write_rt_size: cpus, + bg_rt_size: cpus, } } }