Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ DOCKER_TAG ?= erigontech/erigon:latest
CGO_CFLAGS := $(shell $(GO) env CGO_CFLAGS 2>/dev/null) # don't lose default
#CGO_CFLAGS += -DMDBX_FORCE_ASSERTIONS=0 # Enable MDBX's asserts by default in 'main' branch and disable in releases
#CGO_CFLAGS += -DMDBX_DISABLE_VALIDATION=0 # Can disable it on CI by separated PR which will measure perf impact.
#CGO_CFLAGS += -DMDBX_ENABLE_PROFGC=0 # Disabled by default, but may be useful for performance debugging
#CGO_CFLAGS += -DMDBX_ENABLE_PGOP_STAT=0 # Disabled by default, but may be useful for performance debugging
CGO_CFLAGS += -DMDBX_ENABLE_PROFGC=1 # Disabled by default, but may be useful for performance debugging
CGO_CFLAGS += -DMDBX_ENABLE_PGOP_STAT=1 # Disabled by default, but may be useful for performance debugging
#CGO_CFLAGS += -DMDBX_ENV_CHECKPID=0 # Erigon doesn't do fork() syscall


Expand Down
6 changes: 6 additions & 0 deletions db/kv/kv_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,9 @@ type DBGauges struct { // these gauges are shared by all MDBX instances, but nee
GcLeafMetric *metrics.GaugeVec
GcOverflowMetric *metrics.GaugeVec
GcPagesMetric *metrics.GaugeVec

GCMaxRetainedPages *metrics.GaugeVec
GCMaxReaderLag *metrics.GaugeVec
}

type DBSummaries struct { // the summaries are particular to a DB instance
Expand Down Expand Up @@ -635,6 +638,9 @@ func InitMDBXMGauges() *DBGauges {
GcLeafMetric: metrics.GetOrCreateGaugeVec(`db_gc_leaf`, []string{dbLabelName}),
GcOverflowMetric: metrics.GetOrCreateGaugeVec(`db_gc_overflow`, []string{dbLabelName}),
GcPagesMetric: metrics.GetOrCreateGaugeVec(`db_gc_pages`, []string{dbLabelName}),

GCMaxRetainedPages: metrics.GetOrCreateGaugeVec(`db_gc_max_retained_pages`, []string{dbLabelName}),
GCMaxReaderLag: metrics.GetOrCreateGaugeVec(`db_gc_max_reader_lag`, []string{dbLabelName}),
}
}

Expand Down
6 changes: 6 additions & 0 deletions db/kv/mdbx/kv_mdbx.go
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,12 @@ func (tx *MdbxTx) Commit() error {
tx.db.opts.log.Error("failed to record mdbx summaries", "err", err)
}

kv.MDBXGauges.GCMaxRetainedPages.WithLabelValues(string(dbLabel)).SetUint64(uint64(latency.GCDetails.MaxRetainedPages))
kv.MDBXGauges.GCMaxReaderLag.WithLabelValues(string(dbLabel)).SetUint64(uint64(latency.GCDetails.MaxReaderLag))
if latency.GCDetails.MaxRetainedPages > 0 || latency.GCDetails.MaxReaderLag > 0 {
log.Warn("[dbg] latency.GCDetails", "MaxRetainedPages", latency.GCDetails.MaxRetainedPages, "MaxRetainedPages", latency.GCDetails.MaxRetainedPages)
}

//kv.DbGcWorkPnlMergeTime.Update(latency.GCDetails.WorkPnlMergeTime.Seconds())
//kv.DbGcWorkPnlMergeVolume.Set(uint64(latency.GCDetails.WorkPnlMergeVolume))
//kv.DbGcWorkPnlMergeCalls.Set(uint64(latency.GCDetails.WorkPnlMergeCalls))
Expand Down
3 changes: 2 additions & 1 deletion db/kv/mdbx/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"os"

"github.com/c2h5oh/datasize"
"github.com/erigontech/mdbx-go/mdbx"

"github.com/erigontech/erigon/common/log/v3"
"github.com/erigontech/erigon/db/kv"
"github.com/erigontech/erigon/db/kv/dbcfg"
"github.com/erigontech/mdbx-go/mdbx"
)

func MustOpen(path string) kv.RwDB {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ replace github.com/crate-crypto/go-eth-kzg => github.com/Giulio2002/zero-alloc-g
require (
github.com/erigontech/erigon-snapshot v1.3.1-0.20260105114333-2f59a10db72b
github.com/erigontech/erigonwatch v0.0.0-20240718131902-b6576bde1116
github.com/erigontech/mdbx-go v0.39.12
github.com/erigontech/mdbx-go v0.40.1-0.20260207034341-a73a7db11fcd
github.com/erigontech/secp256k1 v1.2.0
github.com/erigontech/silkworm-go v0.24.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ github.com/erigontech/erigon-snapshot v1.3.1-0.20260105114333-2f59a10db72b h1:xX
github.com/erigontech/erigon-snapshot v1.3.1-0.20260105114333-2f59a10db72b/go.mod h1:ooHlCl+eEYzebiPu+FP6Q6SpPUeMADn8Jxabv3IKb9M=
github.com/erigontech/erigonwatch v0.0.0-20240718131902-b6576bde1116 h1:KCFa2uXEfZoBjV4buzjWmCmoqVLXiGCq0ZmQ2OjeRvQ=
github.com/erigontech/erigonwatch v0.0.0-20240718131902-b6576bde1116/go.mod h1:8vQ+VjvLu2gkPs8EwdPrOTAAo++WuLuBi54N7NuAF0I=
github.com/erigontech/mdbx-go v0.39.12 h1:WjvPzloxXOYfRamIxt8NOB7i3/M8cSCSfWQHvMNANrE=
github.com/erigontech/mdbx-go v0.39.12/go.mod h1:tHUS492F5YZvccRqatNdpTDQAaN+Vv4HRARYq89KqeY=
github.com/erigontech/mdbx-go v0.40.1-0.20260207034341-a73a7db11fcd h1:r0hPSxIH6JmjWKTGv0vHW5EQUvV8n+nRG4cU8OOALmI=
github.com/erigontech/mdbx-go v0.40.1-0.20260207034341-a73a7db11fcd/go.mod h1:qo3aRGnrYWdrQHnUgj7QwYQc562Hd2CCZZc/v5lLSHw=
github.com/erigontech/secp256k1 v1.2.0 h1:Q/HCBMdYYT0sh1xPZ9ZYEnU30oNyb/vt715cJhj7n7A=
github.com/erigontech/secp256k1 v1.2.0/go.mod h1:GokhPepsMB+EYDs7I5JZCprxHW6+yfOcJKaKtoZ+Fls=
github.com/erigontech/silkworm-go v0.24.0 h1:fFe74CjQM5LI7ouMYjmqfFaqIFzQTpMrt+ls+a5PxpE=
Expand Down
Loading