Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
milvus
提交
d5abdd13
milvus
项目概览
BaiXuePrincess
/
milvus
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d5abdd13
编写于
7月 15, 2019
作者:
G
groot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MS-230 - Change parameter name: Maximum_memory to insert_buffer_size
Former-commit-id: b1b1799bca5374b95f1f3dc721f78a0ac00b73e2
上级
830ae4ae
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
10 deletion
+10
-10
cpp/conf/server_config.template
cpp/conf/server_config.template
+2
-2
cpp/src/db/NewMemManager.cpp
cpp/src/db/NewMemManager.cpp
+1
-1
cpp/src/db/Options.h
cpp/src/db/Options.h
+1
-1
cpp/src/server/DBWrapper.cpp
cpp/src/server/DBWrapper.cpp
+5
-5
cpp/src/server/ServerConfig.h
cpp/src/server/ServerConfig.h
+1
-1
未找到文件。
cpp/conf/server_config.template
浏览文件 @
d5abdd13
...
...
@@ -16,8 +16,8 @@ db_config:
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_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.
# the sum of
maximum_memory
and cpu_cache_capacity should be less than total memory
insert_buffer_size: 4 # maximum insert buffer size
allowed, default: 4, unit: GB, should be at least 1 GB.
# the sum of
insert_buffer_size
and cpu_cache_capacity should be less than total memory
metric_config:
is_startup: off # if monitoring start: on, off
...
...
cpp/src/db/NewMemManager.cpp
浏览文件 @
d5abdd13
...
...
@@ -25,7 +25,7 @@ Status NewMemManager::InsertVectors(const std::string &table_id_,
const
float
*
vectors_
,
IDNumbers
&
vector_ids_
)
{
while
(
GetCurrentMem
()
>
options_
.
maximum_memory
)
{
while
(
GetCurrentMem
()
>
options_
.
insert_buffer_size
)
{
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
1
));
}
...
...
cpp/src/db/Options.h
浏览文件 @
d5abdd13
...
...
@@ -63,7 +63,7 @@ struct Options {
size_t
index_trigger_size
=
ONE_GB
;
//unit: byte
DBMetaOptions
meta
;
int
mode
=
MODE
::
SINGLE
;
size_t
maximum_memory
=
4
*
ONE_GB
;
size_t
insert_buffer_size
=
4
*
ONE_GB
;
};
// Options
...
...
cpp/src/server/DBWrapper.cpp
浏览文件 @
d5abdd13
...
...
@@ -28,12 +28,12 @@ DBWrapper::DBWrapper() {
if
(
index_size
>
0
)
{
//ensure larger than zero, unit is MB
opt
.
index_trigger_size
=
(
size_t
)
index_size
*
engine
::
ONE_MB
;
}
int64_t
maximum_memory
=
config
.
GetInt64Value
(
CONFIG_MAXMIMUM_MEMORY
);
if
(
maximum_memory
>
1.0
)
{
opt
.
maximum_memory
=
maximum_memory
*
engine
::
ONE_GB
;
int64_t
insert_buffer_size
=
config
.
GetInt64Value
(
CONFIG_DB_INSERT_BUFFER_SIZE
,
4
);
if
(
insert_buffer_size
>=
1
)
{
opt
.
insert_buffer_size
=
insert_buffer_size
*
engine
::
ONE_GB
;
}
else
if
(
maximum_memory
!=
0
)
{
//if maximum_memory = 0, set it to default
std
::
cout
<<
"ERROR:
maximum_memory
should be at least 1 GB"
<<
std
::
endl
;
else
{
std
::
cout
<<
"ERROR:
insert_buffer_size
should be at least 1 GB"
<<
std
::
endl
;
kill
(
0
,
SIGUSR1
);
}
...
...
cpp/src/server/ServerConfig.h
浏览文件 @
d5abdd13
...
...
@@ -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_ARCHIVE_DISK
=
"archive_disk_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"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录