diff --git a/be/src/vec/exec/scan/scanner_scheduler.cpp b/be/src/vec/exec/scan/scanner_scheduler.cpp index 6b7bc232a2ecaf..2666387956d173 100644 --- a/be/src/vec/exec/scan/scanner_scheduler.cpp +++ b/be/src/vec/exec/scan/scanner_scheduler.cpp @@ -123,9 +123,12 @@ Status ScannerScheduler::init(ExecEnv* env) { config::doris_scanner_thread_pool_queue_size, "local_scan"); // 3. remote scan thread pool + _remote_thread_pool_max_size = config::doris_max_remote_scanner_thread_pool_thread_num != -1 + ? config::doris_max_remote_scanner_thread_pool_thread_num + : std::max(512, CpuInfo::num_cores() * 10); _remote_scan_thread_pool = std::make_unique( - config::doris_remote_scanner_thread_pool_thread_num, - config::doris_remote_scanner_thread_pool_queue_size, "RemoteScanThreadPool"); + _remote_thread_pool_max_size, config::doris_remote_scanner_thread_pool_queue_size, + "RemoteScanThreadPool"); // 4. limited scan thread pool static_cast(ThreadPoolBuilder("LimitedScanThreadPool")