feat: 减少 badger 的内存占用 (#1216)

This commit is contained in:
zhengkunwang223 2023-06-01 14:45:18 +08:00 committed by GitHub
parent 6abd313bd2
commit d40b2734a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,29 +14,29 @@ func Init() {
options := badger.Options{
Dir: c,
ValueDir: c,
ValueLogFileSize: 102400000,
ValueLogMaxEntries: 100000,
ValueLogFileSize: 64 << 20,
ValueLogMaxEntries: 10 << 20,
VLogPercentile: 0.1,
MemTableSize: 64 << 20,
MemTableSize: 32 << 20,
BaseTableSize: 2 << 20,
BaseLevelSize: 10 << 20,
TableSizeMultiplier: 2,
LevelSizeMultiplier: 10,
MaxLevels: 7,
NumGoroutines: 8,
NumGoroutines: 4,
MetricsEnabled: true,
NumCompactors: 4,
NumCompactors: 2,
NumLevelZeroTables: 5,
NumLevelZeroTablesStall: 15,
NumMemtables: 5,
NumMemtables: 1,
BloomFalsePositive: 0.01,
BlockSize: 4 * 1024,
BlockSize: 2 * 1024,
SyncWrites: false,
NumVersionsToKeep: 1,
CompactL0OnClose: false,
VerifyValueChecksum: false,
BlockCacheSize: 256 << 20,
BlockCacheSize: 32 << 20,
IndexCacheSize: 0,
ZSTDCompressionLevel: 1,
EncryptionKey: []byte{},