From f6c930d0aa53c3df36ce4f8d5d9dafb9a542917e Mon Sep 17 00:00:00 2001 From: vyzo Date: Sat, 13 Feb 2021 16:54:19 +0200 Subject: [PATCH] crank up blockstore max readers to 16K, reduce retry delays to 10us --- chain/store/splitstore/lmdb_util.go | 2 +- chain/store/splitstore/splitstore.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chain/store/splitstore/lmdb_util.go b/chain/store/splitstore/lmdb_util.go index 91920bca3..5aff2ed0d 100644 --- a/chain/store/splitstore/lmdb_util.go +++ b/chain/store/splitstore/lmdb_util.go @@ -13,7 +13,7 @@ func withMaxReadersRetry(f func() error) error { retry: err := f() if err != nil && lmdb.IsErrno(err, lmdb.ReadersFull) { - dt := time.Microsecond + time.Duration(rand.Intn(int(time.Millisecond))) + dt := time.Microsecond + time.Duration(rand.Intn(int(10*time.Microsecond))) log.Debugf("MDB_READERS_FULL; retrying operation in %s", dt) time.Sleep(dt) goto retry diff --git a/chain/store/splitstore/splitstore.go b/chain/store/splitstore/splitstore.go index 8edb8993e..19f2c6f12 100644 --- a/chain/store/splitstore/splitstore.go +++ b/chain/store/splitstore/splitstore.go @@ -65,7 +65,8 @@ func NewSplitStore(path string, ds dstore.Datastore, cold bstore.Blockstore) (*S InitialMmapSize: 4 << 30, // 4GiB. MmapGrowthStepFactor: 1.25, // scale slower than the default of 1.5 MmapGrowthStepMax: 4 << 30, // 4GiB - RetryDelay: time.Millisecond, + RetryDelay: 10 * time.Microsecond, + MaxReaders: 16384, }) if err != nil { return nil, err