kaspad/database/ffldb/ldb/options.go
stasatdaglabs 20da1b9c9a
[NOD-1048] Make leveldb compaction much less frequent (#756)
* [NOD-1048] Make leveldb compaction much less frequent. Also, allocate an entire gigabyte for leveldb's blockCache and writeBuffer.

* [NOD-1048] Implement changing the options for testing purposes.

* [NOD-1048] Rename originalOptions to originalLDBOptions.

* [NOD-1048] Add a comment.
2020-06-10 16:05:02 +03:00

20 lines
479 B
Go

package ldb
import "github.com/syndtr/goleveldb/leveldb/opt"
var (
defaultOptions = opt.Options{
Compression: opt.NoCompression,
BlockCacheCapacity: 512 * opt.MiB,
WriteBuffer: 512 * opt.MiB,
IteratorSamplingRate: 512 * opt.MiB,
}
// Options is a function that returns a leveldb
// opt.Options struct for opening a database.
// It's defined as a variable for the sake of testing.
Options = func() *opt.Options {
return &defaultOptions
}
)