From 0e98349c9818d93aa0154e8c1a207869ab75ea65 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Tue, 17 Sep 2013 10:38:56 -0500 Subject: [PATCH] disable compression, don't use cache and limit open files --- ldb/leveldb.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ldb/leveldb.go b/ldb/leveldb.go index 683ca6cc..b0acfe1d 100644 --- a/ldb/leveldb.go +++ b/ldb/leveldb.go @@ -11,6 +11,7 @@ import ( "github.com/conformal/btcwire" "github.com/conformal/seelog" "github.com/syndtr/goleveldb/leveldb" + "github.com/syndtr/goleveldb/leveldb/cache" "github.com/syndtr/goleveldb/leveldb/opt" "os" "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 { return }