From 6a7f90b2bc1ff7745bcb173e68ec9a3c8423511b Mon Sep 17 00:00:00 2001 From: ByteYue Date: Mon, 22 Apr 2024 20:25:22 +0800 Subject: [PATCH] add config --- be/src/common/config.cpp | 7 ++++--- be/src/common/config.h | 7 ++++--- be/src/runtime/exec_env_init.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp index 5376c4d593b342..c821f7ae2f6aef 100644 --- a/be/src/common/config.cpp +++ b/be/src/common/config.cpp @@ -1212,12 +1212,13 @@ DEFINE_mBool(enable_injection_point, "false"); DEFINE_mBool(ignore_schema_change_check, "false"); +// The min thread num for BufferedReaderPrefetchThreadPool DEFINE_Int64(buffered_reader_prefetch_thread_pool_min_thread_num, "16"); - +// The max thread num for BufferedReaderPrefetchThreadPool DEFINE_Int64(buffered_reader_prefetch_thread_pool_max_thread_num, "64"); - +// The min thread num for S3FileUploadThreadPool DEFINE_Int64(s3_file_upload_thread_pool_min_thread_num, "16"); - +// The max thread num for S3FileUploadThreadPool DEFINE_Int64(s3_file_upload_thread_pool_max_thread_num, "64"); // clang-format off diff --git a/be/src/common/config.h b/be/src/common/config.h index 117b7ca82efb80..be2346ea69772c 100644 --- a/be/src/common/config.h +++ b/be/src/common/config.h @@ -1297,12 +1297,13 @@ DECLARE_mBool(enable_injection_point); DECLARE_mBool(ignore_schema_change_check); +// The min thread num for BufferedReaderPrefetchThreadPool DECLARE_Int64(buffered_reader_prefetch_thread_pool_min_thread_num); - +// The max thread num for BufferedReaderPrefetchThreadPool DECLARE_Int64(buffered_reader_prefetch_thread_pool_max_thread_num); - +// The min thread num for S3FileUploadThreadPool DECLARE_Int64(s3_file_upload_thread_pool_min_thread_num); - +// The max thread num for S3FileUploadThreadPool DECLARE_Int64(s3_file_upload_thread_pool_max_thread_num); #ifdef BE_TEST diff --git a/be/src/runtime/exec_env_init.cpp b/be/src/runtime/exec_env_init.cpp index f91e535990ef93..e9b7eb97027484 100644 --- a/be/src/runtime/exec_env_init.cpp +++ b/be/src/runtime/exec_env_init.cpp @@ -185,8 +185,8 @@ Status ExecEnv::_init(const std::vector& store_paths, .build(&_send_batch_thread_pool)); static_cast(ThreadPoolBuilder("BufferedReaderPrefetchThreadPool") - .set_min_threads(16) - .set_max_threads(64) + .set_min_threads(config::buffered_reader_prefetch_thread_pool_min_thread_num) + .set_max_threads(config::buffered_reader_prefetch_thread_pool_max_thread_num) .build(&_buffered_reader_prefetch_thread_pool)); static_cast(ThreadPoolBuilder("SendTableStatsThreadPool") @@ -200,8 +200,8 @@ Status ExecEnv::_init(const std::vector& store_paths, .build(&_s3_downloader_download_poller_thread_pool)); static_cast(ThreadPoolBuilder("S3FileUploadThreadPool") - .set_min_threads(16) - .set_max_threads(64) + .set_min_threads(config::s3_file_upload_thread_pool_min_thread_num) + .set_max_threads(config::s3_file_upload_thread_pool_max_thread_num) .build(&_s3_file_upload_thread_pool)); // min num equal to fragment pool's min num