From 2af46d7333158a619b14f267aea2f7bc413bba9e Mon Sep 17 00:00:00 2001 From: yah01 Date: Tue, 31 Oct 2023 09:06:13 +0800 Subject: [PATCH] Increase the ChunkManager request timeout (#28015) Signed-off-by: yah01 --- configs/milvus.yaml | 2 +- internal/core/src/common/Consts.h | 2 +- internal/core/src/storage/ThreadPool.cpp | 6 +++--- internal/core/src/storage/ThreadPool.h | 10 +++++++--- internal/core/src/storage/ThreadPools.cpp | 9 ++++----- pkg/util/paramtable/base_table.go | 2 +- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/configs/milvus.yaml b/configs/milvus.yaml index d381ff74b7..618e3bceea 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -95,7 +95,7 @@ minio: # Cloud whether use virtual host bucket mode useVirtualHost: false # timeout for request time in milliseconds - requestTimeoutMs: 3000 + requestTimeoutMs: 10000 # Milvus supports four MQ: rocksmq(based on RockDB), natsmq(embedded nats-server), Pulsar and Kafka. # You can change your mq by setting mq.type field. diff --git a/internal/core/src/common/Consts.h b/internal/core/src/common/Consts.h index 9de3b0e48b..ded5ffcdc7 100644 --- a/internal/core/src/common/Consts.h +++ b/internal/core/src/common/Consts.h @@ -53,4 +53,4 @@ constexpr const char* RANGE_FILTER = knowhere::meta::RANGE_FILTER; const int64_t DEFAULT_MAX_OUTPUT_SIZE = 67108864; // bytes, 64MB -const int64_t DEFAULT_CHUNK_MANAGER_REQUEST_TIMEOUT_MS = 3000; +const int64_t DEFAULT_CHUNK_MANAGER_REQUEST_TIMEOUT_MS = 10000; diff --git a/internal/core/src/storage/ThreadPool.cpp b/internal/core/src/storage/ThreadPool.cpp index b81c99c2b7..e9710b0d96 100644 --- a/internal/core/src/storage/ThreadPool.cpp +++ b/internal/core/src/storage/ThreadPool.cpp @@ -37,9 +37,9 @@ ThreadPool::ShutDown() { shutdown_ = true; } condition_lock_.notify_all(); - for (auto iter = threads_.begin(); iter != threads_.end(); ++iter) { - if (iter->second.joinable()) { - iter->second.join(); + for (auto& thread : threads_) { + if (thread.second.joinable()) { + thread.second.join(); } } LOG_SEGCORE_INFO_ << "Finish shutting down " << name_; diff --git a/internal/core/src/storage/ThreadPool.h b/internal/core/src/storage/ThreadPool.h index dc62c2d0ca..6b5e4cfa9f 100644 --- a/internal/core/src/storage/ThreadPool.h +++ b/internal/core/src/storage/ThreadPool.h @@ -33,9 +33,8 @@ namespace milvus { class ThreadPool { public: - explicit ThreadPool(const int thread_core_coefficient, - const std::string& name) - : shutdown_(false), name_(name) { + explicit ThreadPool(const int thread_core_coefficient, std::string name) + : shutdown_(false), name_(std::move(name)) { idle_threads_size_ = 0; current_threads_size_ = 0; min_threads_size_ = CPU_NUM; @@ -69,6 +68,11 @@ class ThreadPool { return current_threads_size_; } + size_t + GetMaxThreadNum() { + return max_threads_size_; + } + template auto // Submit(F&& f, Args&&... args) -> std::future; diff --git a/internal/core/src/storage/ThreadPools.cpp b/internal/core/src/storage/ThreadPools.cpp index e2253fafe2..8acd6dd6f6 100644 --- a/internal/core/src/storage/ThreadPools.cpp +++ b/internal/core/src/storage/ThreadPools.cpp @@ -27,13 +27,12 @@ bool ThreadPools::has_setup_coefficients = false; void ThreadPools::ShutDown() { - for (auto itr = thread_pool_map.begin(); itr != thread_pool_map.end(); - ++itr) { + for (auto& itr : thread_pool_map) { LOG_SEGCORE_INFO_ << "Start shutting down threadPool with priority:" - << itr->first; - itr->second->ShutDown(); + << itr.first; + itr.second->ShutDown(); LOG_SEGCORE_INFO_ << "Finish shutting down threadPool with priority:" - << itr->first; + << itr.first; } } diff --git a/pkg/util/paramtable/base_table.go b/pkg/util/paramtable/base_table.go index db441b04b9..9521c3a008 100644 --- a/pkg/util/paramtable/base_table.go +++ b/pkg/util/paramtable/base_table.go @@ -51,7 +51,7 @@ const ( DefaultKnowhereThreadPoolNumRatioInBuild = 1 DefaultMinioRegion = "" DefaultMinioUseVirtualHost = "false" - DefaultMinioRequestTimeout = "3000" + DefaultMinioRequestTimeout = "10000" ) // Const of Global Config List