Browse Source

weed volume: disable block cache on leveldb

saving 8MB for each volume, but at the cost of slower lookup
pull/925/head
Chris Lu 6 years ago
parent
commit
9924fa3b1a
  1. 5
      weed/storage/needle_map_leveldb.go

5
weed/storage/needle_map_leveldb.go

@ -2,6 +2,7 @@ package storage
import (
"fmt"
"github.com/syndtr/goleveldb/leveldb/opt"
"os"
"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(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
}
glog.V(1).Infof("Loading %s...", indexFile.Name())

Loading…
Cancel
Save