mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-27 20:49:03 +08:00
feat: 减少 badger 的内存占用 (#1216)
This commit is contained in:
parent
6abd313bd2
commit
d40b2734a9
16
backend/init/cache/cache.go
vendored
16
backend/init/cache/cache.go
vendored
@ -14,29 +14,29 @@ func Init() {
|
|||||||
options := badger.Options{
|
options := badger.Options{
|
||||||
Dir: c,
|
Dir: c,
|
||||||
ValueDir: c,
|
ValueDir: c,
|
||||||
ValueLogFileSize: 102400000,
|
ValueLogFileSize: 64 << 20,
|
||||||
ValueLogMaxEntries: 100000,
|
ValueLogMaxEntries: 10 << 20,
|
||||||
VLogPercentile: 0.1,
|
VLogPercentile: 0.1,
|
||||||
|
|
||||||
MemTableSize: 64 << 20,
|
MemTableSize: 32 << 20,
|
||||||
BaseTableSize: 2 << 20,
|
BaseTableSize: 2 << 20,
|
||||||
BaseLevelSize: 10 << 20,
|
BaseLevelSize: 10 << 20,
|
||||||
TableSizeMultiplier: 2,
|
TableSizeMultiplier: 2,
|
||||||
LevelSizeMultiplier: 10,
|
LevelSizeMultiplier: 10,
|
||||||
MaxLevels: 7,
|
MaxLevels: 7,
|
||||||
NumGoroutines: 8,
|
NumGoroutines: 4,
|
||||||
MetricsEnabled: true,
|
MetricsEnabled: true,
|
||||||
NumCompactors: 4,
|
NumCompactors: 2,
|
||||||
NumLevelZeroTables: 5,
|
NumLevelZeroTables: 5,
|
||||||
NumLevelZeroTablesStall: 15,
|
NumLevelZeroTablesStall: 15,
|
||||||
NumMemtables: 5,
|
NumMemtables: 1,
|
||||||
BloomFalsePositive: 0.01,
|
BloomFalsePositive: 0.01,
|
||||||
BlockSize: 4 * 1024,
|
BlockSize: 2 * 1024,
|
||||||
SyncWrites: false,
|
SyncWrites: false,
|
||||||
NumVersionsToKeep: 1,
|
NumVersionsToKeep: 1,
|
||||||
CompactL0OnClose: false,
|
CompactL0OnClose: false,
|
||||||
VerifyValueChecksum: false,
|
VerifyValueChecksum: false,
|
||||||
BlockCacheSize: 256 << 20,
|
BlockCacheSize: 32 << 20,
|
||||||
IndexCacheSize: 0,
|
IndexCacheSize: 0,
|
||||||
ZSTDCompressionLevel: 1,
|
ZSTDCompressionLevel: 1,
|
||||||
EncryptionKey: []byte{},
|
EncryptionKey: []byte{},
|
||||||
|
Loading…
Reference in New Issue
Block a user