weed volume: disable block cache on leveldb
saving 8MB for each volume, but at the cost of slower lookup
This commit is contained in:
@@ -2,6 +2,7 @@ package storage
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
@@ -27,7 +28,9 @@ func NewLevelDbNeedleMap(dbFileName string, indexFile *os.File) (m *LevelDbNeedl
|
|||||||
glog.V(0).Infof("Finished Generating %s from %s", dbFileName, indexFile.Name())
|
glog.V(0).Infof("Finished Generating %s from %s", dbFileName, indexFile.Name())
|
||||||
}
|
}
|
||||||
glog.V(1).Infof("Opening %s...", dbFileName)
|
glog.V(1).Infof("Opening %s...", dbFileName)
|
||||||
if m.db, err = leveldb.OpenFile(dbFileName, nil); err != nil {
|
if m.db, err = leveldb.OpenFile(dbFileName, &opt.Options{
|
||||||
|
BlockCacheCapacity: -1, // default value is 8MiB
|
||||||
|
}); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
glog.V(1).Infof("Loading %s...", indexFile.Name())
|
glog.V(1).Infof("Loading %s...", indexFile.Name())
|
||||||
|
|||||||
Reference in New Issue
Block a user