From 31ff7e1f7c41baec9e0155695e22a4523e4a89d7 Mon Sep 17 00:00:00 2001 From: Pascal Seitz Date: Thu, 8 Aug 2024 16:49:57 +0800 Subject: [PATCH] add env parameter for thread pool size --- quickwit/quickwit-search/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quickwit/quickwit-search/src/lib.rs b/quickwit/quickwit-search/src/lib.rs index b5e7a881c08..6fe6d61de4c 100644 --- a/quickwit/quickwit-search/src/lib.rs +++ b/quickwit/quickwit-search/src/lib.rs @@ -97,7 +97,8 @@ pub type SearcherPool = Pool; fn search_thread_pool() -> &'static ThreadPool { static SEARCH_THREAD_POOL: OnceLock = OnceLock::new(); - SEARCH_THREAD_POOL.get_or_init(|| ThreadPool::new("search", None)) + let search_thread_pool_size = quickwit_common::get_from_env_opt("QW_SEARCH_THREAD_POOL_SIZE"); + SEARCH_THREAD_POOL.get_or_init(|| ThreadPool::new("search", search_thread_pool_size)) } /// GlobalDocAddress serves as a hit address.