Browse Source

Adjust BadgerDB memory settings to prevent OOM issues and update version to v0.8.8.

main
mleku 3 months ago
parent
commit
7d5ebd5ccd
No known key found for this signature in database
  1. 8
      pkg/database/database.go
  2. 2
      pkg/version/version

8
pkg/database/database.go

@ -52,8 +52,12 @@ func New( @@ -52,8 +52,12 @@ func New(
}
opts := badger.DefaultOptions(d.dataDir)
opts.BlockCacheSize = int64(units.Gb)
opts.BlockSize = units.Gb
// Use sane defaults to avoid excessive memory usage during startup.
// Badger's default BlockSize is small (e.g., 4KB). Overriding it to very large values
// can cause massive allocations and OOM panics during deployments.
// Set BlockCacheSize to a moderate value and keep BlockSize small.
opts.BlockCacheSize = int64(256 * units.Mb) // 256 MB cache
opts.BlockSize = 4 * units.Kb // 4 KB block size
opts.CompactL0OnClose = true
opts.LmaxCompaction = true
opts.Compression = options.None

2
pkg/version/version

@ -1 +1 @@ @@ -1 +1 @@
v0.8.7
v0.8.8
Loading…
Cancel
Save