mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 03:48:37 +08:00
enhance: Use a separate mmap config for chunk cache (#36276)
issue: https://github.com/milvus-io/milvus/issues/35273 Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
This commit is contained in:
parent
517f8b3755
commit
763fd0dfc5
@ -412,6 +412,7 @@ queryNode:
|
||||
vectorIndex: false # Enable mmap for loading vector index
|
||||
scalarField: false # Enable mmap for loading scalar data
|
||||
scalarIndex: false # Enable mmap for loading scalar index
|
||||
chunkCache: true # Enable mmap for chunk cache (raw vector retrieving).
|
||||
# Enable memory mapping (mmap) to optimize the handling of growing raw data.
|
||||
# By activating this feature, the memory overhead associated with newly added or modified data will be significantly minimized.
|
||||
# However, this optimization may come at the cost of a slight decrease in query latency for the affected data segments.
|
||||
|
@ -1172,7 +1172,8 @@ func (s *LocalSegment) LoadIndex(ctx context.Context, indexInfo *querypb.FieldIn
|
||||
}
|
||||
|
||||
// 4.
|
||||
s.WarmupChunkCache(ctx, indexInfo.GetFieldID(), isDataMmapEnable(fieldSchema))
|
||||
mmapChunkCache := paramtable.Get().QueryNodeCfg.MmapChunkCache.GetAsBool()
|
||||
s.WarmupChunkCache(ctx, indexInfo.GetFieldID(), mmapChunkCache)
|
||||
warmupChunkCacheSpan := tr.RecordSpan()
|
||||
log.Info("Finish loading index",
|
||||
zap.Duration("newLoadIndexInfoSpan", newLoadIndexInfoSpan),
|
||||
|
@ -376,8 +376,9 @@ func (node *QueryNode) Start() error {
|
||||
growingmmapEnable := paramtable.Get().QueryNodeCfg.GrowingMmapEnabled.GetAsBool()
|
||||
mmapVectorIndex := paramtable.Get().QueryNodeCfg.MmapVectorIndex.GetAsBool()
|
||||
mmapVectorField := paramtable.Get().QueryNodeCfg.MmapVectorField.GetAsBool()
|
||||
mmapScarlarIndex := paramtable.Get().QueryNodeCfg.MmapScalarIndex.GetAsBool()
|
||||
mmapScarlarField := paramtable.Get().QueryNodeCfg.MmapScalarField.GetAsBool()
|
||||
mmapScalarIndex := paramtable.Get().QueryNodeCfg.MmapScalarIndex.GetAsBool()
|
||||
mmapScalarField := paramtable.Get().QueryNodeCfg.MmapScalarField.GetAsBool()
|
||||
mmapChunkCache := paramtable.Get().QueryNodeCfg.MmapChunkCache.GetAsBool()
|
||||
|
||||
node.UpdateStateCode(commonpb.StateCode_Healthy)
|
||||
|
||||
@ -389,8 +390,9 @@ func (node *QueryNode) Start() error {
|
||||
zap.Bool("growingmmapEnable", growingmmapEnable),
|
||||
zap.Bool("mmapVectorIndex", mmapVectorIndex),
|
||||
zap.Bool("mmapVectorField", mmapVectorField),
|
||||
zap.Bool("mmapScarlarIndex", mmapScarlarIndex),
|
||||
zap.Bool("mmapScarlarField", mmapScarlarField),
|
||||
zap.Bool("mmapScalarIndex", mmapScalarIndex),
|
||||
zap.Bool("mmapScalarField", mmapScalarField),
|
||||
zap.Bool("mmapChunkCache", mmapChunkCache),
|
||||
)
|
||||
})
|
||||
|
||||
|
@ -2337,6 +2337,7 @@ type queryNodeConfig struct {
|
||||
MmapVectorIndex ParamItem `refreshable:"false"`
|
||||
MmapScalarField ParamItem `refreshable:"false"`
|
||||
MmapScalarIndex ParamItem `refreshable:"false"`
|
||||
MmapChunkCache ParamItem `refreshable:"false"`
|
||||
GrowingMmapEnabled ParamItem `refreshable:"false"`
|
||||
FixedFileSizeForMmapManager ParamItem `refreshable:"false"`
|
||||
MaxMmapDiskPercentageForMmapManager ParamItem `refreshable:"false"`
|
||||
@ -2663,6 +2664,15 @@ This defaults to true, indicating that Milvus creates temporary index for growin
|
||||
}
|
||||
p.MmapScalarIndex.Init(base.mgr)
|
||||
|
||||
p.MmapChunkCache = ParamItem{
|
||||
Key: "queryNode.mmap.chunkCache",
|
||||
Version: "2.4.12",
|
||||
DefaultValue: "true",
|
||||
Doc: "Enable mmap for chunk cache (raw vector retrieving).",
|
||||
Export: true,
|
||||
}
|
||||
p.MmapChunkCache.Init(base.mgr)
|
||||
|
||||
p.GrowingMmapEnabled = ParamItem{
|
||||
Key: "queryNode.mmap.growingMmapEnabled",
|
||||
Version: "2.4.6",
|
||||
|
@ -454,6 +454,8 @@ func TestComponentParam(t *testing.T) {
|
||||
|
||||
assert.Equal(t, 4, Params.BloomFilterApplyParallelFactor.GetAsInt())
|
||||
assert.Equal(t, "/var/lib/milvus/data/mmap", Params.MmapDirPath.GetValue())
|
||||
|
||||
assert.Equal(t, true, Params.MmapChunkCache.GetAsBool())
|
||||
})
|
||||
|
||||
t.Run("test dataCoordConfig", func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user