From 43185353bcf603c7d97eb1203766bfa88b4b6494 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 4 Aug 2022 18:26:27 +0300 Subject: [PATCH] app/vmselect/netstorage: cleanup after 92630c1ab4c6a968e90fa5b9e47a5bbf087d82bc Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2896 --- app/vmselect/netstorage/netstorage.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/vmselect/netstorage/netstorage.go b/app/vmselect/netstorage/netstorage.go index 2ae266dc5..6a207c9f1 100644 --- a/app/vmselect/netstorage/netstorage.go +++ b/app/vmselect/netstorage/netstorage.go @@ -198,11 +198,9 @@ func (rss *Results) RunParallel(qt *querytracer.Tracer, f func(rs *Result, worke // Spin up up to gomaxprocs local workers and split work equally among them. // This guarantees linear scalability with the increase of gomaxprocs // (e.g. the number of available CPU cores). - workers := len(rss.packedTimeseries) itemsPerWorker := 1 - if workers > gomaxprocs { - itemsPerWorker = 1 + workers/gomaxprocs - workers = gomaxprocs + if len(rss.packedTimeseries) > gomaxprocs { + itemsPerWorker = 1 + len(rss.packedTimeseries)/gomaxprocs } var start int var i uint