From 1c669a69a86404494395c2d3f9e41106822e56d7 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 25 Nov 2020 21:52:17 +0200 Subject: [PATCH] lib/mergeset: tune the number of rawItemsBlocks to merge at once 512 blocks give higher ingestion performance and slightly lower memory usage --- lib/mergeset/table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mergeset/table.go b/lib/mergeset/table.go index b4084b848..4284bc623 100644 --- a/lib/mergeset/table.go +++ b/lib/mergeset/table.go @@ -369,7 +369,7 @@ func (tb *Table) AddItems(items [][]byte) error { tb.rawItemsBlocks = append(tb.rawItemsBlocks, ib) } } - if len(tb.rawItemsBlocks) >= 1024 { + if len(tb.rawItemsBlocks) >= 512 { blocksToMerge = tb.rawItemsBlocks tb.rawItemsBlocks = nil tb.rawItemsLastFlushTime = fasttime.UnixTimestamp()