mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
save
This commit is contained in:
parent
44f909767d
commit
bfda9bc731
@ -22,6 +22,28 @@ func WriteMap() bool {
|
||||
return writeMap
|
||||
}
|
||||
|
||||
var (
|
||||
mergeTr int
|
||||
mergeTrOnce sync.Once
|
||||
)
|
||||
|
||||
func MergeTr() int {
|
||||
mergeTrOnce.Do(func() {
|
||||
v, _ := os.LookupEnv("MERGE_THRESHOLD")
|
||||
if v != "" {
|
||||
i, err := strconv.Atoi(v)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if i < 0 || i > 4 {
|
||||
panic(i)
|
||||
}
|
||||
mergeTr = i
|
||||
}
|
||||
})
|
||||
return mergeTr
|
||||
}
|
||||
|
||||
var (
|
||||
mdbxReaadahead bool
|
||||
mdbxReaadaheadOnce sync.Once
|
||||
|
@ -340,7 +340,10 @@ func OpenDatabase(config *nodecfg.Config, logger log.Logger, label kv.Label) (kv
|
||||
opts = opts.GrowthStep(16 * datasize.MB)
|
||||
}
|
||||
if debug.WriteMap() {
|
||||
opts = opts.WriteMap().WriteMergeThreshold(1 * 8192)
|
||||
opts = opts.WriteMap()
|
||||
}
|
||||
if debug.MergeTr() > 0 {
|
||||
opts = opts.WriteMergeThreshold(uint64(debug.MergeTr() * 8192))
|
||||
}
|
||||
if debug.MdbxReadAhead() {
|
||||
opts = opts.Flags(func(u uint) uint {
|
||||
|
Loading…
Reference in New Issue
Block a user