lib/storage: reduce the amounts of memory which can be occupied by rawRow items during data ingestion on a system with many CPU cores

This commit is contained in:
Aliaksandr Valialkin 2021-06-11 10:49:02 +03:00
parent 67b17cdd68
commit 044ab46824

View file

@ -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
}