mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
weed volume: disable block cache on leveldb
saving 8MB for each volume, but at the cost of slower lookup
This commit is contained in:
parent
35aba35c07
commit
9924fa3b1a
|
@ -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())
|
||||||
|
|
Loading…
Reference in a new issue