Revert "apply --db.read.concurrency flag value when open embedded db" (#5550)

This reverts commit f654ee0dc2.
This commit is contained in:
ledgerwatch 2022-09-27 15:24:22 +01:00 committed by GitHub
parent a968c7ed5b
commit 325bff181e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -384,7 +384,7 @@ var (
DBReadConcurrencyFlag = cli.IntFlag{ DBReadConcurrencyFlag = cli.IntFlag{
Name: "db.read.concurrency", Name: "db.read.concurrency",
Usage: "Does limit amount of parallel db reads. Default: equal to GOMAXPROCS (or number of CPU)", Usage: "Does limit amount of parallel db reads. Default: equal to GOMAXPROCS (or number of CPU)",
Value: cmp.Max(10, runtime.GOMAXPROCS(-1)*4), Value: cmp.Max(10, runtime.GOMAXPROCS(-1)*2),
} }
RpcAccessListFlag = cli.StringFlag{ RpcAccessListFlag = cli.StringFlag{
Name: "rpc.accessList", Name: "rpc.accessList",

View File

@ -30,7 +30,6 @@ import (
"github.com/c2h5oh/datasize" "github.com/c2h5oh/datasize"
"github.com/ledgerwatch/erigon/node/nodecfg" "github.com/ledgerwatch/erigon/node/nodecfg"
"github.com/ledgerwatch/erigon/params" "github.com/ledgerwatch/erigon/params"
"golang.org/x/sync/semaphore"
"github.com/gofrs/flock" "github.com/gofrs/flock"
"github.com/ledgerwatch/erigon-lib/kv" "github.com/ledgerwatch/erigon-lib/kv"
@ -320,8 +319,7 @@ func OpenDatabase(config *nodecfg.Config, logger log.Logger, label kv.Label) (kv
var openFunc func(exclusive bool) (kv.RwDB, error) var openFunc func(exclusive bool) (kv.RwDB, error)
log.Info("Opening Database", "label", name, "path", dbPath) log.Info("Opening Database", "label", name, "path", dbPath)
openFunc = func(exclusive bool) (kv.RwDB, error) { openFunc = func(exclusive bool) (kv.RwDB, error) {
roTxsLimiter := semaphore.NewWeighted(int64(config.Http.DBReadConcurrency)) // 1 less than max to allow unlocking to happen opts := mdbx.NewMDBX(logger).Path(dbPath).Label(label).DBVerbosity(config.DatabaseVerbosity)
opts := mdbx.NewMDBX(logger).Path(dbPath).Label(label).DBVerbosity(config.DatabaseVerbosity).RoTxsLimiter(roTxsLimiter)
if exclusive { if exclusive {
opts = opts.Exclusive() opts = opts.Exclusive()
} }