mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
Revert "apply --db.read.concurrency flag value when open embedded db" (#5550)
This reverts commit f654ee0dc2
.
This commit is contained in:
parent
a968c7ed5b
commit
325bff181e
@ -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",
|
||||||
|
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user