disable compression, don't use cache and limit open files
This commit is contained in:
parent
18b3e86179
commit
0e98349c98
1 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,7 @@ import (
|
||||||
"github.com/conformal/btcwire"
|
"github.com/conformal/btcwire"
|
||||||
"github.com/conformal/seelog"
|
"github.com/conformal/seelog"
|
||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/cache"
|
||||||
"github.com/syndtr/goleveldb/leveldb/opt"
|
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -155,7 +156,10 @@ func openDB(dbpath string, flag opt.OptionsFlag) (pbdb btcdb.Db, err error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tlDb, err = leveldb.OpenFile(dbpath, &opt.Options{Flag: flag})
|
tlDb, err = leveldb.OpenFile(dbpath, &opt.Options{Flag: flag,
|
||||||
|
BlockCache: cache.EmptyCache{},
|
||||||
|
MaxOpenFiles: 256,
|
||||||
|
CompressionType: opt.NoCompression})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue