mdbx: relax a bit merge limit (still leave it stronger than default) (#786)

This commit is contained in:
Alex Sharov 2022-12-17 20:06:19 +07:00 committed by GitHub
parent 199a9c890d
commit 3b68fec09a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,7 +74,7 @@ func NewMDBX(log log.Logger) MdbxOpts {
pageSize: kv.DefaultPageSize(), pageSize: kv.DefaultPageSize(),
dirtySpace: 2 * (memory.TotalMemory() / 42), dirtySpace: 2 * (memory.TotalMemory() / 42),
growthStep: 2 * datasize.GB, growthStep: 2 * datasize.GB,
mergeThreshold: 32768, mergeThreshold: 3 * 8192,
} }
return opts return opts
} }
@ -192,9 +192,6 @@ func (opts MdbxOpts) Open() (kv.RwDB, error) {
if dbg.MergeTr() > 0 { if dbg.MergeTr() > 0 {
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint
} }
if dbg.MergeTr() > 0 {
opts = opts.WriteMergeThreshold(uint64(dbg.MergeTr() * 8192)) //nolint
}
if dbg.MdbxReadAhead() { if dbg.MdbxReadAhead() {
opts = opts.Flags(func(u uint) uint { return u &^ mdbx.NoReadahead }) //nolint opts = opts.Flags(func(u uint) uint { return u &^ mdbx.NoReadahead }) //nolint
} }