提交 d5abdd13 编写于 作者: G groot

MS-230 - Change parameter name: Maximum_memory to insert_buffer_size


Former-commit-id: b1b1799bca5374b95f1f3dc721f78a0ac00b73e2
上级 830ae4ae
...@@ -16,8 +16,8 @@ db_config: ...@@ -16,8 +16,8 @@ db_config:
index_building_threshold: 1024 # index building trigger threshold, default: 1024, unit: MB index_building_threshold: 1024 # index building trigger threshold, default: 1024, unit: MB
archive_disk_threshold: 0 # triger archive action if storage size exceed this value, 0 means no limit, unit: GB archive_disk_threshold: 0 # triger archive action if storage size exceed this value, 0 means no limit, unit: GB
archive_days_threshold: 0 # files older than x days will be archived, 0 means no limit, unit: day archive_days_threshold: 0 # files older than x days will be archived, 0 means no limit, unit: day
maximum_memory: 4 # maximum memory allowed, default: 4, unit: GB, should be at least 1 GB. insert_buffer_size: 4 # maximum insert buffer size allowed, default: 4, unit: GB, should be at least 1 GB.
# the sum of maximum_memory and cpu_cache_capacity should be less than total memory # the sum of insert_buffer_size and cpu_cache_capacity should be less than total memory
metric_config: metric_config:
is_startup: off # if monitoring start: on, off is_startup: off # if monitoring start: on, off
......
...@@ -25,7 +25,7 @@ Status NewMemManager::InsertVectors(const std::string &table_id_, ...@@ -25,7 +25,7 @@ Status NewMemManager::InsertVectors(const std::string &table_id_,
const float *vectors_, const float *vectors_,
IDNumbers &vector_ids_) { IDNumbers &vector_ids_) {
while (GetCurrentMem() > options_.maximum_memory) { while (GetCurrentMem() > options_.insert_buffer_size) {
std::this_thread::sleep_for(std::chrono::milliseconds(1)); std::this_thread::sleep_for(std::chrono::milliseconds(1));
} }
......
...@@ -63,7 +63,7 @@ struct Options { ...@@ -63,7 +63,7 @@ struct Options {
size_t index_trigger_size = ONE_GB; //unit: byte size_t index_trigger_size = ONE_GB; //unit: byte
DBMetaOptions meta; DBMetaOptions meta;
int mode = MODE::SINGLE; int mode = MODE::SINGLE;
size_t maximum_memory = 4 * ONE_GB; size_t insert_buffer_size = 4 * ONE_GB;
}; // Options }; // Options
......
...@@ -28,12 +28,12 @@ DBWrapper::DBWrapper() { ...@@ -28,12 +28,12 @@ DBWrapper::DBWrapper() {
if(index_size > 0) {//ensure larger than zero, unit is MB if(index_size > 0) {//ensure larger than zero, unit is MB
opt.index_trigger_size = (size_t)index_size * engine::ONE_MB; opt.index_trigger_size = (size_t)index_size * engine::ONE_MB;
} }
int64_t maximum_memory = config.GetInt64Value(CONFIG_MAXMIMUM_MEMORY); int64_t insert_buffer_size = config.GetInt64Value(CONFIG_DB_INSERT_BUFFER_SIZE, 4);
if (maximum_memory > 1.0) { if (insert_buffer_size >= 1) {
opt.maximum_memory = maximum_memory * engine::ONE_GB; opt.insert_buffer_size = insert_buffer_size * engine::ONE_GB;
} }
else if (maximum_memory != 0) { //if maximum_memory = 0, set it to default else {
std::cout << "ERROR: maximum_memory should be at least 1 GB" << std::endl; std::cout << "ERROR: insert_buffer_size should be at least 1 GB" << std::endl;
kill(0, SIGUSR1); kill(0, SIGUSR1);
} }
......
...@@ -27,7 +27,7 @@ static const std::string CONFIG_DB_SLAVE_PATH = "db_slave_path"; ...@@ -27,7 +27,7 @@ static const std::string CONFIG_DB_SLAVE_PATH = "db_slave_path";
static const std::string CONFIG_DB_INDEX_TRIGGER_SIZE = "index_building_threshold"; static const std::string CONFIG_DB_INDEX_TRIGGER_SIZE = "index_building_threshold";
static const std::string CONFIG_DB_ARCHIVE_DISK = "archive_disk_threshold"; static const std::string CONFIG_DB_ARCHIVE_DISK = "archive_disk_threshold";
static const std::string CONFIG_DB_ARCHIVE_DAYS = "archive_days_threshold"; static const std::string CONFIG_DB_ARCHIVE_DAYS = "archive_days_threshold";
static const std::string CONFIG_MAXMIMUM_MEMORY = "maximum_memory"; static const std::string CONFIG_DB_INSERT_BUFFER_SIZE = "insert_buffer_size";
static const std::string CONFIG_LOG = "log_config"; static const std::string CONFIG_LOG = "log_config";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册