diff --git a/erigon-lib/kv/mdbx/kv_mdbx.go b/erigon-lib/kv/mdbx/kv_mdbx.go index a528dc7bdb8..0e954500476 100644 --- a/erigon-lib/kv/mdbx/kv_mdbx.go +++ b/erigon-lib/kv/mdbx/kv_mdbx.go @@ -63,7 +63,6 @@ type MdbxOpts struct { // must be in the range from 12.5% (almost empty) to 50% (half empty) // which corresponds to the range from 8192 and to 32768 in units respectively log log.Logger - roTxsLimiter *semaphore.Weighted bucketsCfg TableCfgFunc path string syncPeriod time.Duration @@ -78,6 +77,11 @@ type MdbxOpts struct { label kv.Label // marker to distinct db instances - one process may open many databases. for example to collect metrics of only 1 database inMem bool + // roTxsLimiter - without this limiter - it's possible to reach 10K threads (if 10K rotx will wait for IO) - and golang will crush https://groups.google.com/g/golang-dev/c/igMoDruWNwo + // most of db must set explicit `roTxsLimiter <= 9K`. + // There is way to increase the 10,000 thread limit: https://golang.org/pkg/runtime/debug/#SetMaxThreads + roTxsLimiter *semaphore.Weighted + metrics bool }