From d06c0e7a94814efd27e6d98d3440fcb4c7099a02 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 11 Jun 2021 10:49:02 +0300 Subject: [PATCH] lib/storage: reduce the amounts of memory which can be occupied by rawRow items during data ingestion on a system with many CPU cores --- lib/storage/partition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/storage/partition.go b/lib/storage/partition.go index 22ace71754..1395477586 100644 --- a/lib/storage/partition.go +++ b/lib/storage/partition.go @@ -82,7 +82,7 @@ var rawRowsShardsPerPartition = (cgroup.AvailableCPUs() + 7) / 8 // getMaxRowsPerPartition returns the maximum number of rows that haven't been converted into parts yet. func getMaxRawRowsPerPartition() int { maxRawRowsPerPartitionOnce.Do(func() { - n := memory.Allowed() / 256 / int(unsafe.Sizeof(rawRow{})) + n := memory.Allowed() / rawRowsShardsPerPartition / 256 / int(unsafe.Sizeof(rawRow{})) if n < 1e4 { n = 1e4 }