mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Merge pull request #2321 from joshuafc/patch-1
add bloom filter to leveldb_store to improve fuse performance.
This commit is contained in:
commit
35c8ea495f
|
@ -6,6 +6,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/syndtr/goleveldb/leveldb"
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
leveldb_errors "github.com/syndtr/goleveldb/leveldb/errors"
|
leveldb_errors "github.com/syndtr/goleveldb/leveldb/errors"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/filter"
|
||||||
"github.com/syndtr/goleveldb/leveldb/opt"
|
"github.com/syndtr/goleveldb/leveldb/opt"
|
||||||
leveldb_util "github.com/syndtr/goleveldb/leveldb/util"
|
leveldb_util "github.com/syndtr/goleveldb/leveldb/util"
|
||||||
"os"
|
"os"
|
||||||
|
@ -48,6 +49,7 @@ func (store *LevelDBStore) initialize(dir string) (err error) {
|
||||||
BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiB
|
BlockCacheCapacity: 32 * 1024 * 1024, // default value is 8MiB
|
||||||
WriteBuffer: 16 * 1024 * 1024, // default value is 4MiB
|
WriteBuffer: 16 * 1024 * 1024, // default value is 4MiB
|
||||||
CompactionTableSizeMultiplier: 10,
|
CompactionTableSizeMultiplier: 10,
|
||||||
|
Filter: filter.NewBloomFilter(8), // false positive rate 0.02
|
||||||
}
|
}
|
||||||
|
|
||||||
if store.db, err = leveldb.OpenFile(dir, opts); err != nil {
|
if store.db, err = leveldb.OpenFile(dir, opts); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue