Skip to content

Commit

Permalink
Merge pull request #267 from coinbase/patrick/modify-performance-options
Browse files Browse the repository at this point in the history
[database] Update BadgerDB Performance Settings
  • Loading branch information
patrick-ogrady authored Dec 5, 2020
2 parents c04c542 + 7e4d691 commit 0f2c511
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion storage/database/badger_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ const (
// DefaultLogValueSize is 64 MB.
DefaultLogValueSize = 64 << 20

// PerformanceMaxTableSize is 3072 MB. The larger
// this value is, the larger database transactions
// storage can handle (~15% of the max table size
// == max commit size).
PerformanceMaxTableSize = 3072 << 20

// PerformanceLogValueSize is 256 MB.
PerformanceLogValueSize = 256 << 20

// DefaultCompressionMode is the default block
// compression setting.
DefaultCompressionMode = options.None
Expand Down Expand Up @@ -165,7 +174,8 @@ func PerformanceBadgerOptions(dir string) badger.Options {
opts.Compression = DefaultCompressionMode

// Use an extended table size for larger commits.
opts.MaxTableSize = DefaultMaxTableSize
opts.MaxTableSize = PerformanceMaxTableSize
opts.ValueLogFileSize = PerformanceLogValueSize

// Load tables into memory and memory map value logs.
opts.TableLoadingMode = options.MemoryMap
Expand Down

0 comments on commit 0f2c511

Please sign in to comment.