Loading cpp/src/cache/CpuCacheMgr.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -30,10 +30,21 @@ namespace { CpuCacheMgr::CpuCacheMgr() { server::Config& config = server::Config::GetInstance(); int64_t cap = config.GetCacheConfigCpuMemCapacity() * unit; Status s; int32_t cpu_mem_cap; s = config.GetCacheConfigCpuMemCapacity(cpu_mem_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int64_t cap = cpu_mem_cap * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); float cpu_mem_threshold = config.GetCacheConfigCpuMemThreshold(); float cpu_mem_threshold; s = config.GetCacheConfigCpuMemThreshold(cpu_mem_threshold); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } if (cpu_mem_threshold > 0.0 && cpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(cpu_mem_threshold); } else { Loading cpp/src/cache/GpuCacheMgr.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -34,11 +34,21 @@ namespace { GpuCacheMgr::GpuCacheMgr() { server::Config& config = server::Config::GetInstance(); Status s; int32_t cap = config.GetCacheConfigGpuMemCapacity() * G_BYTE; int32_t gpu_mem_cap; s = config.GetCacheConfigGpuMemCapacity(gpu_mem_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int32_t cap = gpu_mem_cap * G_BYTE; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); float gpu_mem_threshold = config.GetCacheConfigGpuMemThreshold(); float gpu_mem_threshold; s = config.GetCacheConfigGpuMemThreshold(gpu_mem_threshold); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(gpu_mem_threshold); } else { Loading cpp/src/db/engine/ExecutionEngineImpl.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,8 @@ Status ExecutionEngineImpl::GpuCache(uint64_t gpu_id) { Status ExecutionEngineImpl::Init() { using namespace zilliz::milvus::server; server::Config &config = server::Config::GetInstance(); gpu_num_ = config.GetDBConfigBuildIndexGPU(); Status s = config.GetDBConfigBuildIndexGPU(gpu_num_); if (!s.ok()) return s; return Status::OK(); } Loading cpp/src/db/engine/ExecutionEngineImpl.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ protected: std::string location_; int32_t nlist_ = 0; int64_t gpu_num_ = 0; int32_t gpu_num_ = 0; }; Loading cpp/src/metrics/Metrics.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,9 @@ Metrics::GetInstance() { MetricsBase & Metrics::CreateMetricsCollector() { Config &config = Config::GetInstance(); std::string collector_type_str = config.GetMetricConfigCollector(); std::string collector_type_str; config.GetMetricConfigCollector(collector_type_str); if (collector_type_str == "prometheus") { return PrometheusMetrics::GetInstance(); Loading Loading
cpp/src/cache/CpuCacheMgr.cpp +13 −2 Original line number Diff line number Diff line Loading @@ -30,10 +30,21 @@ namespace { CpuCacheMgr::CpuCacheMgr() { server::Config& config = server::Config::GetInstance(); int64_t cap = config.GetCacheConfigCpuMemCapacity() * unit; Status s; int32_t cpu_mem_cap; s = config.GetCacheConfigCpuMemCapacity(cpu_mem_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int64_t cap = cpu_mem_cap * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); float cpu_mem_threshold = config.GetCacheConfigCpuMemThreshold(); float cpu_mem_threshold; s = config.GetCacheConfigCpuMemThreshold(cpu_mem_threshold); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } if (cpu_mem_threshold > 0.0 && cpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(cpu_mem_threshold); } else { Loading
cpp/src/cache/GpuCacheMgr.cpp +12 −2 Original line number Diff line number Diff line Loading @@ -34,11 +34,21 @@ namespace { GpuCacheMgr::GpuCacheMgr() { server::Config& config = server::Config::GetInstance(); Status s; int32_t cap = config.GetCacheConfigGpuMemCapacity() * G_BYTE; int32_t gpu_mem_cap; s = config.GetCacheConfigGpuMemCapacity(gpu_mem_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int32_t cap = gpu_mem_cap * G_BYTE; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); float gpu_mem_threshold = config.GetCacheConfigGpuMemThreshold(); float gpu_mem_threshold; s = config.GetCacheConfigGpuMemThreshold(gpu_mem_threshold); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(gpu_mem_threshold); } else { Loading
cpp/src/db/engine/ExecutionEngineImpl.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -336,7 +336,8 @@ Status ExecutionEngineImpl::GpuCache(uint64_t gpu_id) { Status ExecutionEngineImpl::Init() { using namespace zilliz::milvus::server; server::Config &config = server::Config::GetInstance(); gpu_num_ = config.GetDBConfigBuildIndexGPU(); Status s = config.GetDBConfigBuildIndexGPU(gpu_num_); if (!s.ok()) return s; return Status::OK(); } Loading
cpp/src/db/engine/ExecutionEngineImpl.h +1 −1 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ protected: std::string location_; int32_t nlist_ = 0; int64_t gpu_num_ = 0; int32_t gpu_num_ = 0; }; Loading
cpp/src/metrics/Metrics.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,9 @@ Metrics::GetInstance() { MetricsBase & Metrics::CreateMetricsCollector() { Config &config = Config::GetInstance(); std::string collector_type_str = config.GetMetricConfigCollector(); std::string collector_type_str; config.GetMetricConfigCollector(collector_type_str); if (collector_type_str == "prometheus") { return PrometheusMetrics::GetInstance(); Loading