From 32df191e7efa2305b4ad79073c4508b1fc1e2c0d Mon Sep 17 00:00:00 2001 From: Mark Holt <135143369+mh0lt@users.noreply.github.com> Date: Mon, 17 Jul 2023 20:48:43 +0100 Subject: [PATCH] add map size setter (#1050) Add a bound the txpool db, rather than leaving it as the default of 2TB. This is to reduce the page file profile when running multiple nodes from around 3.5GB per txpool instance. The current pool map side is set to 512MB - which seems reasonable with 16MB increments --- txpool/txpooluitl/all_components.go | 1 + 1 file changed, 1 insertion(+) diff --git a/txpool/txpooluitl/all_components.go b/txpool/txpooluitl/all_components.go index 12494ff14..f6977a7e5 100644 --- a/txpool/txpooluitl/all_components.go +++ b/txpool/txpooluitl/all_components.go @@ -105,6 +105,7 @@ func AllComponents(ctx context.Context, cfg txpoolcfg.Config, cache kvcache.Cach txPoolDB, err := mdbx.NewMDBX(log.New()).Label(kv.TxPoolDB).Path(cfg.DBDir). WithTableCfg(func(defaultBuckets kv.TableCfg) kv.TableCfg { return kv.TxpoolTablesCfg }). Flags(func(f uint) uint { return f ^ mdbx2.Durable | mdbx2.SafeNoSync }). + MapSize(512 * datasize.MB). GrowthStep(16 * datasize.MB). SyncPeriod(30 * time.Second). Open()