Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add max open files limit of 512 to rocksdb init #85

Merged
merged 1 commit into from
Jul 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion eth/trie/backends/rocksdb_backend.nim
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ type

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] =
let s = db.store.getBytes(key)
if s.ok:
Expand Down Expand Up @@ -44,7 +48,8 @@ proc newChainDB*(basePath: string, readOnly = false): ChainDB =
createDir(dataDir)
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 readOnly:
Expand Down