diff options
author | Péter Szilágyi <peterke@gmail.com> | 2016-02-19 20:29:19 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2016-03-09 16:33:39 +0800 |
commit | e90958cd29a228b051faeaa25d66e053cf9d2228 (patch) | |
tree | dd7dd52d31628375ead8a06e681441102faf9037 /eth/backend.go | |
parent | 05c86c2c9fa14ea03fdc5d0cd77cdecc34e4f164 (diff) | |
download | dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar.gz dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar.bz2 dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar.lz dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar.xz dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.tar.zst dexon-e90958cd29a228b051faeaa25d66e053cf9d2228.zip |
cmd, eth, ethdb, node: prioritise chaindata for resources, bump cache
Diffstat (limited to 'eth/backend.go')
-rw-r--r-- | eth/backend.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/eth/backend.go b/eth/backend.go index f62ee976d..d807f8ae8 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -69,6 +69,7 @@ type Config struct { BlockChainVersion int SkipBcVersionCheck bool // e.g. blockchain export DatabaseCache int + DatabaseHandles int NatSpec bool DocRoot string @@ -135,12 +136,8 @@ type Ethereum struct { } func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { - // Let the database take 3/4 of the max open files (TODO figure out a way to get the actual limit of the open files) - const dbCount = 3 - ethdb.OpenFileLimit = 128 / (dbCount + 1) - // Open the chain database and perform any upgrades needed - chainDb, err := ctx.OpenDatabase("chaindata", config.DatabaseCache) + chainDb, err := ctx.OpenDatabase("chaindata", config.DatabaseCache, config.DatabaseHandles) if err != nil { return nil, err } @@ -154,7 +151,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) { return nil, err } - dappDb, err := ctx.OpenDatabase("dapp", config.DatabaseCache) + dappDb, err := ctx.OpenDatabase("dapp", config.DatabaseCache, config.DatabaseHandles) if err != nil { return nil, err } |