Reduce scheduler duration of index task from 1s to 500ms (#21893)

Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
pull/21941/head
cai.zhang 2023-02-02 15:01:51 +08:00 committed by GitHub
parent 4fa8b90141
commit 85dd8912eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -253,6 +253,9 @@ indexCoord:
gc:
interval: 600 # gc interval in seconds
scheduler:
interval: 1000 # scheduler interval in Millisecond
indexNode:
port: 21121
enableDisk: true # enable index node build disk vector index

View File

@ -59,7 +59,7 @@ func newIndexBuilder(ctx context.Context, ic *IndexCoord, metaTable *metaTable,
ic: ic,
tasks: make(map[int64]indexTaskState),
notifyChan: make(chan struct{}, 1),
scheduleDuration: time.Second,
scheduleDuration: Params.IndexCoordCfg.SchedulerInterval,
}
ib.reloadFromKV(aliveNodes)
return ib

View File

@ -1621,7 +1621,8 @@ type indexCoordConfig struct {
MinSegmentNumRowsToEnableIndex int64
GCInterval time.Duration
SchedulerInterval time.Duration
GCInterval time.Duration
CreatedTime time.Time
UpdatedTime time.Time
@ -1633,6 +1634,7 @@ func (p *indexCoordConfig) init(base *BaseTable) {
p.Base = base
p.initGCInterval()
p.initSchedulerInterval()
p.initMinSegmentNumRowsToEnableIndex()
p.initBindIndexNodeMode()
p.initIndexNodeAddress()
@ -1650,6 +1652,10 @@ func (p *indexCoordConfig) initGCInterval() {
p.GCInterval = time.Duration(p.Base.ParseInt64WithDefault("indexCoord.gc.interval", 60*10)) * time.Second
}
func (p *indexCoordConfig) initSchedulerInterval() {
p.SchedulerInterval = time.Duration(p.Base.ParseInt64WithDefault("indexCoord.scheduler.interval", 1000)) * time.Millisecond
}
func (p *indexCoordConfig) initBindIndexNodeMode() {
p.BindIndexNodeMode = p.Base.ParseBool("indexCoord.bindIndexNodeMode.enable", false)
}