Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Commit 0f72eda

Browse files
Toby Padillatoby
authored andcommitted
Decrease default vlog value size to 10MB
1 parent 79e4e6b commit 0f72eda

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

kv/kv.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,16 @@ func OpenWithDefaults(name string) (*KV, error) {
5656
}
5757
pn := filepath.Join(fmt.Sprintf("%s/kv/", dd), name)
5858
opts := badger.DefaultOptions(pn).WithLoggingLevel(badger.ERROR)
59+
5960
// By default we have no logger as it will interfere with Bubble Tea
6061
// rendering. Use Open with custom options to specify one.
6162
opts.Logger = nil
63+
64+
// We default to a 10MB vlog max size (which BadgerDB turns into 20MB vlog
65+
// files). The Badger default results in 2GB vlog files, which is quite
66+
// large. This will limit the values to 10MB maximum size. If you need more,
67+
// please use Open with custom options.
68+
opts = opts.WithValueLogFileSize(10000000)
6269
return Open(cc, name, opts)
6370
}
6471

0 commit comments

Comments
 (0)