Loading cpp/conf/server_config.template +4 −4 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ server_config: time_zone: UTC+8 db_config: db_path: @MILVUS_DB_PATH@ # milvus database path db_slave_path: # secondary database path, split by semicolon path: @MILVUS_DB_PATH@ # milvus database path slave_path: # secondary database path, split by semicolon # URI format: dialect://username:password@host:port/database # All parts except dialect are optional, but you MUST include the delimiters # Currently dialect supports mysql or sqlite db_backend_url: sqlite://:@:/ backend_url: sqlite://:@:/ archive_disk_threshold: 0 # GB, file will be archived when disk usage exceed, 0 for no limit archive_days_threshold: 0 # DAYS, older files will be archived, 0 for no limit Loading @@ -27,7 +27,7 @@ metric_config: cache_config: cpu_mem_capacity: 16 # GB, CPU memory size used for cache cpu_mem_threshold: 0.85 # percent of data kept when cache cleanup triggered insert_immediately: false # whether load data into cache when insert cache_insert_data: false # whether load data into cache when insert engine_config: blas_threshold: 20 Loading cpp/src/cache/CpuCacheMgr.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -29,19 +29,16 @@ namespace { } CpuCacheMgr::CpuCacheMgr() { server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); int64_t cap = config.GetInt64Value(server::CONFIG_CACHE_CPU_MEM_CAPACITY, std::stoi(server::CONFIG_CACHE_CPU_MEM_CAPACITY_DEFAULT)); cap *= unit; server::ServerConfig& config = server::ServerConfig::GetInstance(); int64_t cap = config.GetCacheConfigCpuMemCapacity() * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); double free_percent = config.GetDoubleValue(server::CONFIG_CACHE_CPU_MEM_THRESHOLD, std::stof(server::CONFIG_CACHE_CPU_MEM_THRESHOLD_DEFAULT)); if(free_percent > 0.0 && free_percent <= 1.0) { cache_->set_freemem_percent(free_percent); float cpu_mem_threshold = config.GetCacheConfigCpuMemThreshold(); if (cpu_mem_threshold > 0.0 && cpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(cpu_mem_threshold); } else { SERVER_LOG_ERROR << "Invalid cache_free_percent: " << free_percent << ", defaultly set to " << cache_->freemem_percent(); SERVER_LOG_ERROR << "Invalid cpu_mem_threshold: " << cpu_mem_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading cpp/src/cache/GpuCacheMgr.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -33,20 +33,17 @@ namespace { } GpuCacheMgr::GpuCacheMgr() { server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); server::ServerConfig& config = server::ServerConfig::GetInstance(); int64_t cap = config.GetInt64Value(server::CONFIG_CACHE_GPU_MEM_CAPACITY, std::stoi(server::CONFIG_CACHE_GPU_MEM_CAPACITY_DEFAULT)); cap *= G_BYTE; int32_t cap = config.GetCacheConfigGpuMemCapacity() * G_BYTE; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); double free_percent = config.GetDoubleValue(server::CONFIG_CACHE_GPU_MEM_THRESHOLD, std::stof(server::CONFIG_CACHE_GPU_MEM_THRESHOLD_DEFAULT)); if (free_percent > 0.0 && free_percent <= 1.0) { cache_->set_freemem_percent(free_percent); float gpu_mem_threshold = config.GetCacheConfigGpuMemThreshold(); if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(gpu_mem_threshold); } else { SERVER_LOG_ERROR << "Invalid gpu_cache_free_percent: " << free_percent << ", defaultly set to " << cache_->freemem_percent(); SERVER_LOG_ERROR << "Invalid gpu_mem_threshold: " << gpu_mem_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading cpp/src/db/engine/ExecutionEngineImpl.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -335,8 +335,7 @@ Status ExecutionEngineImpl::GpuCache(uint64_t gpu_id) { Status ExecutionEngineImpl::Init() { using namespace zilliz::milvus::server; ServerConfig &config = ServerConfig::GetInstance(); ConfigNode server_config = config.GetConfig(CONFIG_DB); gpu_num_ = server_config.GetInt32Value(CONFIG_DB_BUILD_INDEX_GPU, std::stoi(CONFIG_DB_BUILD_INDEX_GPU_DEFAULT)); gpu_num_ = config.GetDBConfigBuildIndexGPU(); return Status::OK(); } Loading cpp/src/metrics/Metrics.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ // under the License. #include "Metrics.h" #include "server/ServerConfig.h" #include "PrometheusMetrics.h" Loading @@ -31,9 +32,8 @@ Metrics::GetInstance() { MetricsBase & Metrics::CreateMetricsCollector() { ConfigNode &config = ServerConfig::GetInstance().GetConfig(CONFIG_METRIC); std::string collector_type_str = config.GetValue(CONFIG_METRIC_COLLECTOR, CONFIG_METRIC_COLLECTOR_DEFAULT); ServerConfig &config = ServerConfig::GetInstance(); std::string collector_type_str = config.GetMetricConfigCollector(); if (collector_type_str == "prometheus") { return PrometheusMetrics::GetInstance(); Loading Loading
cpp/conf/server_config.template +4 −4 Original line number Diff line number Diff line Loading @@ -5,13 +5,13 @@ server_config: time_zone: UTC+8 db_config: db_path: @MILVUS_DB_PATH@ # milvus database path db_slave_path: # secondary database path, split by semicolon path: @MILVUS_DB_PATH@ # milvus database path slave_path: # secondary database path, split by semicolon # URI format: dialect://username:password@host:port/database # All parts except dialect are optional, but you MUST include the delimiters # Currently dialect supports mysql or sqlite db_backend_url: sqlite://:@:/ backend_url: sqlite://:@:/ archive_disk_threshold: 0 # GB, file will be archived when disk usage exceed, 0 for no limit archive_days_threshold: 0 # DAYS, older files will be archived, 0 for no limit Loading @@ -27,7 +27,7 @@ metric_config: cache_config: cpu_mem_capacity: 16 # GB, CPU memory size used for cache cpu_mem_threshold: 0.85 # percent of data kept when cache cleanup triggered insert_immediately: false # whether load data into cache when insert cache_insert_data: false # whether load data into cache when insert engine_config: blas_threshold: 20 Loading
cpp/src/cache/CpuCacheMgr.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -29,19 +29,16 @@ namespace { } CpuCacheMgr::CpuCacheMgr() { server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); int64_t cap = config.GetInt64Value(server::CONFIG_CACHE_CPU_MEM_CAPACITY, std::stoi(server::CONFIG_CACHE_CPU_MEM_CAPACITY_DEFAULT)); cap *= unit; server::ServerConfig& config = server::ServerConfig::GetInstance(); int64_t cap = config.GetCacheConfigCpuMemCapacity() * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); double free_percent = config.GetDoubleValue(server::CONFIG_CACHE_CPU_MEM_THRESHOLD, std::stof(server::CONFIG_CACHE_CPU_MEM_THRESHOLD_DEFAULT)); if(free_percent > 0.0 && free_percent <= 1.0) { cache_->set_freemem_percent(free_percent); float cpu_mem_threshold = config.GetCacheConfigCpuMemThreshold(); if (cpu_mem_threshold > 0.0 && cpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(cpu_mem_threshold); } else { SERVER_LOG_ERROR << "Invalid cache_free_percent: " << free_percent << ", defaultly set to " << cache_->freemem_percent(); SERVER_LOG_ERROR << "Invalid cpu_mem_threshold: " << cpu_mem_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading
cpp/src/cache/GpuCacheMgr.cpp +7 −10 Original line number Diff line number Diff line Loading @@ -33,20 +33,17 @@ namespace { } GpuCacheMgr::GpuCacheMgr() { server::ConfigNode& config = server::ServerConfig::GetInstance().GetConfig(server::CONFIG_CACHE); server::ServerConfig& config = server::ServerConfig::GetInstance(); int64_t cap = config.GetInt64Value(server::CONFIG_CACHE_GPU_MEM_CAPACITY, std::stoi(server::CONFIG_CACHE_GPU_MEM_CAPACITY_DEFAULT)); cap *= G_BYTE; int32_t cap = config.GetCacheConfigGpuMemCapacity() * G_BYTE; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL<<32); double free_percent = config.GetDoubleValue(server::CONFIG_CACHE_GPU_MEM_THRESHOLD, std::stof(server::CONFIG_CACHE_GPU_MEM_THRESHOLD_DEFAULT)); if (free_percent > 0.0 && free_percent <= 1.0) { cache_->set_freemem_percent(free_percent); float gpu_mem_threshold = config.GetCacheConfigGpuMemThreshold(); if (gpu_mem_threshold > 0.0 && gpu_mem_threshold <= 1.0) { cache_->set_freemem_percent(gpu_mem_threshold); } else { SERVER_LOG_ERROR << "Invalid gpu_cache_free_percent: " << free_percent << ", defaultly set to " << cache_->freemem_percent(); SERVER_LOG_ERROR << "Invalid gpu_mem_threshold: " << gpu_mem_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading
cpp/src/db/engine/ExecutionEngineImpl.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -335,8 +335,7 @@ Status ExecutionEngineImpl::GpuCache(uint64_t gpu_id) { Status ExecutionEngineImpl::Init() { using namespace zilliz::milvus::server; ServerConfig &config = ServerConfig::GetInstance(); ConfigNode server_config = config.GetConfig(CONFIG_DB); gpu_num_ = server_config.GetInt32Value(CONFIG_DB_BUILD_INDEX_GPU, std::stoi(CONFIG_DB_BUILD_INDEX_GPU_DEFAULT)); gpu_num_ = config.GetDBConfigBuildIndexGPU(); return Status::OK(); } Loading
cpp/src/metrics/Metrics.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ // under the License. #include "Metrics.h" #include "server/ServerConfig.h" #include "PrometheusMetrics.h" Loading @@ -31,9 +32,8 @@ Metrics::GetInstance() { MetricsBase & Metrics::CreateMetricsCollector() { ConfigNode &config = ServerConfig::GetInstance().GetConfig(CONFIG_METRIC); std::string collector_type_str = config.GetValue(CONFIG_METRIC_COLLECTOR, CONFIG_METRIC_COLLECTOR_DEFAULT); ServerConfig &config = ServerConfig::GetInstance(); std::string collector_type_str = config.GetMetricConfigCollector(); if (collector_type_str == "prometheus") { return PrometheusMetrics::GetInstance(); Loading