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

shed: improve leveldb configuration (#1339)

parent f85df8b3
......@@ -32,7 +32,9 @@ import (
)
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
......@@ -55,6 +57,9 @@ func NewDB(path string) (db *DB, err error) {
} else {
ldb, err = leveldb.OpenFile(path, &opt.Options{
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