调整缓存索引数据库缓存尺寸

This commit is contained in:
刘祥超
2023-11-06 20:26:57 +08:00
parent c34a38857a
commit 1e56247b9c
2 changed files with 83 additions and 3 deletions

View File

@@ -65,10 +65,10 @@ func (this *FileListDB) Open(dbPath string) error {
this.dbPath = dbPath
// 动态调整Cache值
var cacheSize = 32000
var cacheSize = 512
var memoryGB = utils.SystemMemoryGB()
if memoryGB >= 8 {
cacheSize += 32000 * memoryGB / 8
if memoryGB >= 1 {
cacheSize = 128 * memoryGB
}
// write db