From 3b68fec09a787cc322a43f5d97741000f0e2aab2 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Sat, 17 Dec 2022 20:06:19 +0700 Subject: [PATCH] mdbx: relax a bit merge limit (still leave it stronger than default) (#786) --- kv/mdbx/kv_mdbx.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kv/mdbx/kv_mdbx.go b/kv/mdbx/kv_mdbx.go index e26f66ffe..346a6a3fd 100644 --- a/kv/mdbx/kv_mdbx.go +++ b/kv/mdbx/kv_mdbx.go @@ -74,7 +74,7 @@ func NewMDBX(log log.Logger) MdbxOpts { pageSize: kv.DefaultPageSize(), dirtySpace: 2 * (memory.TotalMemory() / 42), growthStep: 2 * datasize.GB, - mergeThreshold: 32768, + mergeThreshold: 3 * 8192, } return opts } @@ -192,9 +192,6 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) { if dbg.MergeTr() > 0 { opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint } - if dbg.MergeTr() > 0 { - opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint - } if dbg.MdbxReadAhead() { opts = opts.Flags(func(u uint) uint { return u &^ mdbx.NoReadahead }) //nolint }