Commit 72e0573a authored by acud's avatar acud Committed by GitHub

shed: improve leveldb configuration (#1339)

parent f85df8b3
...@@ -32,7 +32,9 @@ import ( ...@@ -32,7 +32,9 @@ import (
) )
var ( var (
openFileLimit = 128 // The limit for LevelDB OpenFilesCacheCapacity. openFileLimit = 128 // The limit for LevelDB OpenFilesCacheCapacity.
blockCacheCapacity = 32 * 1024 * 1024
writeBuffer = 32 * 1024 * 1024
) )
// DB provides abstractions over LevelDB in order to // DB provides abstractions over LevelDB in order to
...@@ -55,6 +57,9 @@ func NewDB(path string) (db *DB, err error) { ...@@ -55,6 +57,9 @@ func NewDB(path string) (db *DB, err error) {
} else { } else {
ldb, err = leveldb.OpenFile(path, &opt.Options{ ldb, err = leveldb.OpenFile(path, &opt.Options{
OpenFilesCacheCapacity: openFileLimit, OpenFilesCacheCapacity: openFileLimit,
BlockCacheCapacity: blockCacheCapacity,
DisableSeeksCompaction: true,
WriteBuffer: writeBuffer,
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment