mdbx: reduce 2 times hard dplimit (#9216)

can do it, because we don't do read-after-write in same rwtx
This commit is contained in:
Alex Sharov 2024-01-12 17:27:18 +07:00 committed by GitHub
parent 3bb1917e8a
commit e806db977f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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