Loading cpp/README.md +8 −5 Original line number Diff line number Diff line Loading @@ -50,10 +50,9 @@ Centos7 : $ yum install gfortran qt4 flex bison $ yum install mysql-devel mysql Ubuntu16.04 : Ubuntu 16.04 or 18.04: $ sudo apt-get install gfortran qt4-qmake flex bison $ sudo apt-get install libmysqlclient-dev mysql-client ``` Verify the existence of `libmysqlclient_r.so`: Loading @@ -66,6 +65,10 @@ $ locate libmysqlclient_r.so If not, you need to create a symbolic link: ```shell # Locate libmysqlclient.so $ sudo updatedb $ locate libmysqlclient.so # Create symbolic link $ sudo ln -s /path/to/libmysqlclient.so /path/to/libmysqlclient_r.so ``` Loading @@ -90,7 +93,7 @@ please reinstall CMake with curl: ```shell CentOS 7: $ yum install curl-devel Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install libcurl4-openssl-dev ``` Loading @@ -106,7 +109,7 @@ please reinstall CMake with curl: ```shell CentOS 7: $ yum install clang Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install clang-format clang-tidy $ ./build.sh -l Loading @@ -123,7 +126,7 @@ $ ./build.sh -u ```shell CentOS 7: $ yum install lcov Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install lcov $ ./build.sh -u -c Loading cpp/build-support/lint_exclusions.txt +2 −4 Original line number Diff line number Diff line *cmake-build-debug* *cmake-build-release* *cmake_build* *src/thirdparty* *src/core/thirdparty* *thirdparty* *src/grpc* *easylogging++* *SqliteMetaImpl.cpp *src/grpc* *src/core* *src/wrapper* No newline at end of file *unittest/wrapper* No newline at end of file cpp/build.sh +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then echo "ERROR! cpplint check failed" exit 1 fi echo "cpplint check pass!" echo "cpplint check passed!" # # clang-format check # make check-clang-format Loading @@ -110,7 +110,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then # echo "ERROR! clang-format check failed" # exit 1 # fi # echo "clang-format check pass!" # echo "clang-format check passed!" # # # clang-tidy check # make check-clang-tidy Loading @@ -118,7 +118,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then # echo "ERROR! clang-tidy check failed" # exit 1 # fi # echo "clang-tidy check pass!" # echo "clang-tidy check passed!" else # compile and build make -j 4 || exit 1 Loading cpp/conf/server_config.template +9 −7 Original line number Diff line number Diff line # All the following configurations are default values. # Default values are used when you make no changes to the following parameters. server_config: address: 0.0.0.0 # milvus server ip address (IPv4) Loading @@ -11,25 +11,27 @@ db_config: secondary_path: # path used to store data only, split by semicolon backend_url: sqlite://:@:/ # URI format: dialect://username:password@host:port/database # Keep 'dialect://:@:/', and replace other texts with real values. # Keep 'dialect://:@:/', and replace other texts with real values # Replace 'dialect' with 'mysql' or 'sqlite' insert_buffer_size: 4 # GB, maximum insert buffer size allowed # sum of insert_buffer_size and cpu_cache_capacity cannot exceed total memory build_index_gpu: 0 # gpu id used for building index metric_config: enable_monitor: false # enable monitoring or not collector: prometheus # prometheus prometheus_config: port: 8080 # port prometheus used to fetch metrics port: 8080 # port prometheus uses to fetch metrics cache_config: cpu_mem_capacity: 16 # GB, CPU memory used for cache cpu_mem_threshold: 0.85 # percentage of data kept when cache cleanup triggered cache_insert_data: false # whether load inserted data into cache cpu_cache_capacity: 16 # GB, CPU memory used for cache cpu_cache_threshold: 0.85 # percentage of data that will be kept when cache cleanup is triggered cache_insert_data: false # whether to load inserted data into cache engine_config: blas_threshold: 20 use_blas_threshold: 20 # if nq < use_blas_threshold, use SSE, faster with fluctuated response times # if nq >= use_blas_threshold, use OpenBlas, slower with stable response times resource_config: resource_pool: Loading cpp/src/cache/CpuCacheMgr.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -34,23 +34,23 @@ CpuCacheMgr::CpuCacheMgr() { server::Config &config = server::Config::GetInstance(); Status s; int32_t cpu_mem_cap; s = config.GetCacheConfigCpuMemCapacity(cpu_mem_cap); int32_t cpu_cache_cap; s = config.GetCacheConfigCpuCacheCapacity(cpu_cache_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int64_t cap = cpu_mem_cap * unit; int64_t cap = cpu_cache_cap * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32); float cpu_mem_threshold; s = config.GetCacheConfigCpuMemThreshold(cpu_mem_threshold); float cpu_cache_threshold; s = config.GetCacheConfigCpuCacheThreshold(cpu_cache_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); if (cpu_cache_threshold > 0.0 && cpu_cache_threshold <= 1.0) { cache_->set_freemem_percent(cpu_cache_threshold); } else { SERVER_LOG_ERROR << "Invalid cpu_mem_threshold: " << cpu_mem_threshold SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading Loading
cpp/README.md +8 −5 Original line number Diff line number Diff line Loading @@ -50,10 +50,9 @@ Centos7 : $ yum install gfortran qt4 flex bison $ yum install mysql-devel mysql Ubuntu16.04 : Ubuntu 16.04 or 18.04: $ sudo apt-get install gfortran qt4-qmake flex bison $ sudo apt-get install libmysqlclient-dev mysql-client ``` Verify the existence of `libmysqlclient_r.so`: Loading @@ -66,6 +65,10 @@ $ locate libmysqlclient_r.so If not, you need to create a symbolic link: ```shell # Locate libmysqlclient.so $ sudo updatedb $ locate libmysqlclient.so # Create symbolic link $ sudo ln -s /path/to/libmysqlclient.so /path/to/libmysqlclient_r.so ``` Loading @@ -90,7 +93,7 @@ please reinstall CMake with curl: ```shell CentOS 7: $ yum install curl-devel Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install libcurl4-openssl-dev ``` Loading @@ -106,7 +109,7 @@ please reinstall CMake with curl: ```shell CentOS 7: $ yum install clang Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install clang-format clang-tidy $ ./build.sh -l Loading @@ -123,7 +126,7 @@ $ ./build.sh -u ```shell CentOS 7: $ yum install lcov Ubuntu 16.04: Ubuntu 16.04 or 18.04: $ sudo apt-get install lcov $ ./build.sh -u -c Loading
cpp/build-support/lint_exclusions.txt +2 −4 Original line number Diff line number Diff line *cmake-build-debug* *cmake-build-release* *cmake_build* *src/thirdparty* *src/core/thirdparty* *thirdparty* *src/grpc* *easylogging++* *SqliteMetaImpl.cpp *src/grpc* *src/core* *src/wrapper* No newline at end of file *unittest/wrapper* No newline at end of file
cpp/build.sh +3 −3 Original line number Diff line number Diff line Loading @@ -102,7 +102,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then echo "ERROR! cpplint check failed" exit 1 fi echo "cpplint check pass!" echo "cpplint check passed!" # # clang-format check # make check-clang-format Loading @@ -110,7 +110,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then # echo "ERROR! clang-format check failed" # exit 1 # fi # echo "clang-format check pass!" # echo "clang-format check passed!" # # # clang-tidy check # make check-clang-tidy Loading @@ -118,7 +118,7 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then # echo "ERROR! clang-tidy check failed" # exit 1 # fi # echo "clang-tidy check pass!" # echo "clang-tidy check passed!" else # compile and build make -j 4 || exit 1 Loading
cpp/conf/server_config.template +9 −7 Original line number Diff line number Diff line # All the following configurations are default values. # Default values are used when you make no changes to the following parameters. server_config: address: 0.0.0.0 # milvus server ip address (IPv4) Loading @@ -11,25 +11,27 @@ db_config: secondary_path: # path used to store data only, split by semicolon backend_url: sqlite://:@:/ # URI format: dialect://username:password@host:port/database # Keep 'dialect://:@:/', and replace other texts with real values. # Keep 'dialect://:@:/', and replace other texts with real values # Replace 'dialect' with 'mysql' or 'sqlite' insert_buffer_size: 4 # GB, maximum insert buffer size allowed # sum of insert_buffer_size and cpu_cache_capacity cannot exceed total memory build_index_gpu: 0 # gpu id used for building index metric_config: enable_monitor: false # enable monitoring or not collector: prometheus # prometheus prometheus_config: port: 8080 # port prometheus used to fetch metrics port: 8080 # port prometheus uses to fetch metrics cache_config: cpu_mem_capacity: 16 # GB, CPU memory used for cache cpu_mem_threshold: 0.85 # percentage of data kept when cache cleanup triggered cache_insert_data: false # whether load inserted data into cache cpu_cache_capacity: 16 # GB, CPU memory used for cache cpu_cache_threshold: 0.85 # percentage of data that will be kept when cache cleanup is triggered cache_insert_data: false # whether to load inserted data into cache engine_config: blas_threshold: 20 use_blas_threshold: 20 # if nq < use_blas_threshold, use SSE, faster with fluctuated response times # if nq >= use_blas_threshold, use OpenBlas, slower with stable response times resource_config: resource_pool: Loading
cpp/src/cache/CpuCacheMgr.cpp +8 −8 Original line number Diff line number Diff line Loading @@ -34,23 +34,23 @@ CpuCacheMgr::CpuCacheMgr() { server::Config &config = server::Config::GetInstance(); Status s; int32_t cpu_mem_cap; s = config.GetCacheConfigCpuMemCapacity(cpu_mem_cap); int32_t cpu_cache_cap; s = config.GetCacheConfigCpuCacheCapacity(cpu_cache_cap); if (!s.ok()) { SERVER_LOG_ERROR << s.message(); } int64_t cap = cpu_mem_cap * unit; int64_t cap = cpu_cache_cap * unit; cache_ = std::make_shared<Cache<DataObjPtr>>(cap, 1UL << 32); float cpu_mem_threshold; s = config.GetCacheConfigCpuMemThreshold(cpu_mem_threshold); float cpu_cache_threshold; s = config.GetCacheConfigCpuCacheThreshold(cpu_cache_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); if (cpu_cache_threshold > 0.0 && cpu_cache_threshold <= 1.0) { cache_->set_freemem_percent(cpu_cache_threshold); } else { SERVER_LOG_ERROR << "Invalid cpu_mem_threshold: " << cpu_mem_threshold SERVER_LOG_ERROR << "Invalid cpu_cache_threshold: " << cpu_cache_threshold << ", by default set to " << cache_->freemem_percent(); } } Loading