lib/mergeset: tune the number of rawItemsBlocks to merge at once

512 blocks give higher ingestion performance and slightly lower memory usage
This commit is contained in:
Aliaksandr Valialkin 2020-11-25 21:52:17 +02:00
parent 7119f294f3
commit 1c669a69a8

View file

@ -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()