From 199a9c890d4c52b5ae2032e8042dc45ae311b17d Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Sat, 17 Dec 2022 16:54:03 +0700 Subject: [PATCH] e3: increase default wal limit (#785) --- state/inverted_index.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/state/inverted_index.go b/state/inverted_index.go index 610fe7d40..479408151 100644 --- a/state/inverted_index.go +++ b/state/inverted_index.go @@ -374,7 +374,8 @@ func (ii *invertedIndexWAL) close() { } } -var WALCollectorRam = etl.BufferOptimalSize / 16 +// 3 history + 4 indices = 10 etl collectors, 10*256Mb/16 = 256mb - for all indices buffers +var WALCollectorRam = 2 * (etl.BufferOptimalSize / 16) func init() { v, _ := os.LookupEnv("ERIGON_WAL_COLLETOR_RAM") @@ -394,7 +395,6 @@ func (ii *InvertedIndex) newWriter(tmpdir string, buffered, discard bool) *inver tmpdir: tmpdir, } if buffered { - // 3 history + 4 indices = 10 etl collectors, 10*256Mb/16 = 256mb - for all indices buffers // etl collector doesn't fsync: means if have enough ram, all files produced by all collectors will be in ram w.index = etl.NewCollector(ii.indexTable, tmpdir, etl.NewSortableBuffer(WALCollectorRam)) w.indexKeys = etl.NewCollector(ii.indexKeysTable, tmpdir, etl.NewSortableBuffer(WALCollectorRam))