From 9f24321d13bd22a875cea5bf5f29ee17141f4bbb Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Mon, 29 Jan 2024 12:23:25 +0000 Subject: [PATCH] hack: use a single runtime in pageserver doesn't seem to make a meaningful perf difference under get-page-latest-lsn load --- pageserver/src/task_mgr.rs | 46 +++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/pageserver/src/task_mgr.rs b/pageserver/src/task_mgr.rs index 5a06a97525..3cc236c134 100644 --- a/pageserver/src/task_mgr.rs +++ b/pageserver/src/task_mgr.rs @@ -104,29 +104,29 @@ use crate::shutdown_pageserver; // other operations, if the upload tasks e.g. get blocked on locks. It shouldn't // happen, but still. // -pub static COMPUTE_REQUEST_RUNTIME: Lazy = Lazy::new(|| { - tokio::runtime::Builder::new_multi_thread() - .thread_name("compute request worker") - .enable_all() - .build() - .expect("Failed to create compute request runtime") -}); +// pub static COMPUTE_REQUEST_RUNTIME: Lazy = Lazy::new(|| { +// tokio::runtime::Builder::new_multi_thread() +// .thread_name("compute request worker") +// .enable_all() +// .build() +// .expect("Failed to create compute request runtime") +// }); -pub static MGMT_REQUEST_RUNTIME: Lazy = Lazy::new(|| { - tokio::runtime::Builder::new_multi_thread() - .thread_name("mgmt request worker") - .enable_all() - .build() - .expect("Failed to create mgmt request runtime") -}); +// pub static MGMT_REQUEST_RUNTIME: Lazy = Lazy::new(|| { +// tokio::runtime::Builder::new_multi_thread() +// .thread_name("mgmt request worker") +// .enable_all() +// .build() +// .expect("Failed to create mgmt request runtime") +// }); -pub static WALRECEIVER_RUNTIME: Lazy = Lazy::new(|| { - tokio::runtime::Builder::new_multi_thread() - .thread_name("walreceiver worker") - .enable_all() - .build() - .expect("Failed to create walreceiver runtime") -}); +// pub static WALRECEIVER_RUNTIME: Lazy = Lazy::new(|| { +// tokio::runtime::Builder::new_multi_thread() +// .thread_name("walreceiver worker") +// .enable_all() +// .build() +// .expect("Failed to create walreceiver runtime") +// }); pub static BACKGROUND_RUNTIME: Lazy = Lazy::new(|| { tokio::runtime::Builder::new_multi_thread() @@ -150,6 +150,10 @@ pub(crate) static BACKGROUND_RUNTIME_WORKER_THREADS: Lazy = Lazy::new(|| .unwrap_or_else(|_e| usize::max(2, num_cpus::get())) }); +pub static COMPUTE_REQUEST_RUNTIME: &once_cell::sync::Lazy = &BACKGROUND_RUNTIME; +pub static MGMT_REQUEST_RUNTIME: &once_cell::sync::Lazy = &BACKGROUND_RUNTIME; +pub static WALRECEIVER_RUNTIME: &once_cell::sync::Lazy = &BACKGROUND_RUNTIME; + #[derive(Debug, Clone, Copy)] pub struct PageserverTaskId(u64);