Skip to content

Commit

Permalink
[dbnode] Add logs for the effective query index concurrency and max w…
Browse files Browse the repository at this point in the history
…orker time (#3642)
  • Loading branch information
robskillington authored Aug 2, 2021
1 parent eb72a77 commit 0ab7b10
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/dbnode/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,12 +466,20 @@ func Run(runOpts RunOptions) {
maxIdxConcurrency := int(math.Ceil(float64(runtime.NumCPU()) / 2))
if cfg.Index.MaxQueryIDsConcurrency > 0 {
maxIdxConcurrency = cfg.Index.MaxQueryIDsConcurrency
logger.Info("max index query IDs concurrency set",
zap.Int("maxIdxConcurrency", maxIdxConcurrency))
} else {
logger.Warn("max index query IDs concurrency was not set, falling back to default value")
logger.Info("max index query IDs concurrency was not set, falling back to default value",
zap.Int("maxIdxConcurrency", maxIdxConcurrency))
}
maxWorkerTime := time.Second
if cfg.Index.MaxWorkerTime > 0 {
maxWorkerTime = cfg.Index.MaxWorkerTime
logger.Info("max index worker time set",
zap.Duration("maxWorkerTime", maxWorkerTime))
} else {
logger.Info("max index worker time was not set, falling back to default value",
zap.Duration("maxWorkerTime", maxWorkerTime))
}
opts = opts.SetPermitsOptions(permitOptions.SetIndexQueryPermitsManager(
permits.NewFixedPermitsManager(maxIdxConcurrency, int64(maxWorkerTime), iOpts)))
Expand Down

0 comments on commit 0ab7b10

Please sign in to comment.