mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
lib/storage: limit loops count in order to reduce max CPU usage during filter search
This commit is contained in:
parent
e2a0c8bd72
commit
41fe707bec
@ -2979,6 +2979,9 @@ func (is *indexSearch) getMetricIDsForDateAndFilters(date uint64, tfs *TagFilter
|
||||
break
|
||||
}
|
||||
maxLoopsCount := getFirstPositiveFilterLoopsCount(tfws[i+1:])
|
||||
if maxLoopsCount == int64Max {
|
||||
maxLoopsCount = int64(metricIDsLen) * loopsCountPerMetricNameMatch
|
||||
}
|
||||
m, filterLoopsCount, err := is.getMetricIDsForDateTagFilter(tf, date, tfs.commonPrefix, intMax, maxLoopsCount)
|
||||
if err != nil {
|
||||
if errors.Is(err, errTooManyLoops) {
|
||||
|
Loading…
Reference in New Issue
Block a user