mirror of https://github.com/status-im/nim-eth.git
Add max open files limit of 512 to rocksdb init
This commit is contained in:
parent
e195868a64
commit
5389884ecf
|
@ -7,6 +7,10 @@ type
|
||||||
|
|
||||||
ChainDB* = RocksChainDB
|
ChainDB* = RocksChainDB
|
||||||
|
|
||||||
|
# Maximum open files for rocksdb, set to 512 to be safe for usual 1024 Linux
|
||||||
|
# limit per application
|
||||||
|
const maxOpenFiles = 512
|
||||||
|
|
||||||
proc get*(db: ChainDB, key: openarray[byte]): seq[byte] =
|
proc get*(db: ChainDB, key: openarray[byte]): seq[byte] =
|
||||||
let s = db.store.getBytes(key)
|
let s = db.store.getBytes(key)
|
||||||
if s.ok:
|
if s.ok:
|
||||||
|
@ -44,7 +48,8 @@ proc newChainDB*(basePath: string, readOnly = false): ChainDB =
|
||||||
createDir(dataDir)
|
createDir(dataDir)
|
||||||
createDir(backupsDir)
|
createDir(backupsDir)
|
||||||
|
|
||||||
let s = result.store.init(dataDir, backupsDir, readOnly)
|
let s = result.store.init(dataDir, backupsDir, readOnly,
|
||||||
|
maxOpenFiles = maxOpenFiles)
|
||||||
if not s.ok: raiseStorageInitError()
|
if not s.ok: raiseStorageInitError()
|
||||||
|
|
||||||
if not readOnly:
|
if not readOnly:
|
||||||
|
|
Loading…
Reference in New Issue