Hi!
I’m trying to learn a bit more about the internals of Badger and the LSM tree to be able to fine-tune my database: a simple sha1->sha256 map, what makes all keys and values have the same size respectively.
- Should I tweak
ValueThreshold
, (e.g. usingLSMOnlyOptions
) so all my data fits into the tree? - Using the default options,
badger info
shows:[ 2020-11-13T21:40:04Z] MANIFEST 932 B MA [ now] 000087.sst 71 MB L1 [ now] 000088.sst 30 MB L1 [ 4 months earlier] 000000.vlog 72 MB VL [ 1 second earlier] 000001.vlog 22 MB VL [EXTRA] [2020-07-08T08:32:59Z] KEYREGISTRY 28 B [Summary] Level 0 size: 0 B Level 1 size: 101 MB Total index size: 101 MB Value log size: 94 MB Abnormalities: 1 extra file. 0 missing files. 0 empty files. 0 truncated manifests.
- Given that the
MemoryMap
loading mode will pre-allocate2*ValueLogFileSize
=2GB
, most of this memory is unused, if I understand correctly. IsValueLogFileSize=256MB
a reasonable value? - My data will only increase over time, what are the implications of using a too-small
ValueLogFileSize
?
- Given that the
- Is there any additional option I should be looking at? e.g. to adjust key/value to the expected data?