From f5ae701c8d319e18978cfc0510bab3932b6ec08b Mon Sep 17 00:00:00 2001 From: Ning Sun Date: Fri, 14 Jun 2024 22:20:46 -0700 Subject: [PATCH] chore: update sample config files and default settings --- config/datanode.example.toml | 4 +++- config/frontend.example.toml | 4 +++- config/metasrv.example.toml | 4 +++- config/standalone.example.toml | 4 +++- src/cmd/tests/load_config_test.rs | 8 ++++---- src/common/runtime/src/global.rs | 4 ++-- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/config/datanode.example.toml b/config/datanode.example.toml index 16ffbbb0a4..9454adff77 100644 --- a/config/datanode.example.toml +++ b/config/datanode.example.toml @@ -42,7 +42,9 @@ read_rt_size = 8 ## The number of threads to execute the runtime for global write operations. write_rt_size = 8 ## The number of threads to execute the runtime for global background operations. -bg_rt_size = 8 +bg_rt_size = 4 +## The number of threads to execute the runtime for heartbeat operations. +hb_rt_size = 2 ## The heartbeat options. [heartbeat] diff --git a/config/frontend.example.toml b/config/frontend.example.toml index 4f4bd5bf3d..c2d460a613 100644 --- a/config/frontend.example.toml +++ b/config/frontend.example.toml @@ -12,7 +12,9 @@ read_rt_size = 8 ## The number of threads to execute the runtime for global write operations. write_rt_size = 8 ## The number of threads to execute the runtime for global background operations. -bg_rt_size = 8 +bg_rt_size = 4 +## The number of threads to execute the runtime for heartbeat operations. +hb_rt_size = 2 ## The heartbeat options. [heartbeat] diff --git a/config/metasrv.example.toml b/config/metasrv.example.toml index 239533bd58..baac4b26f4 100644 --- a/config/metasrv.example.toml +++ b/config/metasrv.example.toml @@ -32,7 +32,9 @@ read_rt_size = 8 ## The number of threads to execute the runtime for global write operations. write_rt_size = 8 ## The number of threads to execute the runtime for global background operations. -bg_rt_size = 8 +bg_rt_size = 4 +## The number of threads to execute the runtime for heartbeat operations. +hb_rt_size = 2 ## Procedure storage options. [procedure] diff --git a/config/standalone.example.toml b/config/standalone.example.toml index d6fcc3e894..8972b4a129 100644 --- a/config/standalone.example.toml +++ b/config/standalone.example.toml @@ -15,7 +15,9 @@ read_rt_size = 8 ## The number of threads to execute the runtime for global write operations. write_rt_size = 8 ## The number of threads to execute the runtime for global background operations. -bg_rt_size = 8 +bg_rt_size = 4 +## The number of threads to execute the runtime for heartbeat operations. +hb_rt_size = 2 ## The HTTP server options. [http] diff --git a/src/cmd/tests/load_config_test.rs b/src/cmd/tests/load_config_test.rs index a25f1883c2..7128bf0edc 100644 --- a/src/cmd/tests/load_config_test.rs +++ b/src/cmd/tests/load_config_test.rs @@ -42,7 +42,7 @@ fn test_load_datanode_example_config() { read_rt_size: 8, write_rt_size: 8, bg_rt_size: 4, - hb_rt_size: 1, + hb_rt_size: 2, }, component: DatanodeOptions { node_id: Some(42), @@ -102,7 +102,7 @@ fn test_load_frontend_example_config() { read_rt_size: 8, write_rt_size: 8, bg_rt_size: 4, - hb_rt_size: 1, + hb_rt_size: 2, }, component: FrontendOptions { default_timezone: Some("UTC".to_string()), @@ -151,7 +151,7 @@ fn test_load_metasrv_example_config() { read_rt_size: 8, write_rt_size: 8, bg_rt_size: 4, - hb_rt_size: 1, + hb_rt_size: 2, }, component: MetasrvOptions { selector: SelectorType::LeaseBased, @@ -185,7 +185,7 @@ fn test_load_standalone_example_config() { read_rt_size: 8, write_rt_size: 8, bg_rt_size: 4, - hb_rt_size: 1, + hb_rt_size: 2, }, component: StandaloneOptions { default_timezone: Some("UTC".to_string()), diff --git a/src/common/runtime/src/global.rs b/src/common/runtime/src/global.rs index 092ffc190b..984c6fc773 100644 --- a/src/common/runtime/src/global.rs +++ b/src/common/runtime/src/global.rs @@ -26,7 +26,7 @@ use crate::{Builder, JoinHandle, Runtime}; const READ_WORKERS: usize = 8; const WRITE_WORKERS: usize = 8; const BG_WORKERS: usize = 4; -const HB_WORKERS: usize = 1; +const HB_WORKERS: usize = 2; /// The options for the global runtimes. #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] @@ -49,7 +49,7 @@ impl Default for RuntimeOptions { read_rt_size: cpus, write_rt_size: cpus, bg_rt_size: usize::max(cpus / 2, 1), - hb_rt_size: 1, + hb_rt_size: HB_WORKERS, } } }