From e806db977f1b6e59665c7414bae6dcca3beb3087 Mon Sep 17 00:00:00 2001 From: Alex Sharov Date: Fri, 12 Jan 2024 17:27:18 +0700 Subject: [PATCH] mdbx: reduce 2 times hard dplimit (#9216) can do it, because we don't do read-after-write in same rwtx --- erigon-lib/kv/mdbx/kv_mdbx.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erigon-lib/kv/mdbx/kv_mdbx.go b/erigon-lib/kv/mdbx/kv_mdbx.go index 85aeb7341..cd465b593 100644 --- a/erigon-lib/kv/mdbx/kv_mdbx.go +++ b/erigon-lib/kv/mdbx/kv_mdbx.go @@ -326,8 +326,8 @@ func (opts MdbxOpts) Open(ctx context.Context) (kv.RwDB, error) { } else { dirtySpace = mmap.TotalMemory() / 42 // it's default of mdbx, but our package also supports cgroups and GOMEMLIMIT // clamp to max size - const dirtySpaceMaxChainDB = uint64(2 * datasize.GB) - const dirtySpaceMaxDefault = uint64(256 * datasize.MB) + const dirtySpaceMaxChainDB = uint64(1 * datasize.GB) + const dirtySpaceMaxDefault = uint64(128 * datasize.MB) if opts.label == kv.ChainDB && dirtySpace > dirtySpaceMaxChainDB { dirtySpace = dirtySpaceMaxChainDB