lib/mergeset: tune caches size limits for indexdb/dataBlocks and indexdb/indexBlocks

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2007
This commit is contained in:
Aliaksandr Valialkin 2022-01-21 12:45:29 +02:00
parent 5f84b17ed6
commit ede93469ea
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 3 additions and 3 deletions

View file

@ -17,7 +17,7 @@ var ibCache = blockcache.NewCache(getMaxInmemoryBlocksCacheSize)
func getMaxIndexBlocksCacheSize() int {
maxIndexBlockCacheSizeOnce.Do(func() {
maxIndexBlockCacheSize = memory.Allowed() / 10
maxIndexBlockCacheSize = int(0.2 * float64(memory.Allowed()))
})
return maxIndexBlockCacheSize
}
@ -29,7 +29,7 @@ var (
func getMaxInmemoryBlocksCacheSize() int {
maxInmemoryBlockCacheSizeOnce.Do(func() {
maxInmemoryBlockCacheSize = memory.Allowed() / 4
maxInmemoryBlockCacheSize = int(0.3 * float64(memory.Allowed()))
})
return maxInmemoryBlockCacheSize
}

View file

@ -16,7 +16,7 @@ var ibCache = blockcache.NewCache(getMaxIndexBlocksCacheSize)
func getMaxIndexBlocksCacheSize() int {
maxIndexBlockCacheSizeOnce.Do(func() {
maxIndexBlockCacheSize = memory.Allowed() / 10
maxIndexBlockCacheSize = int(0.1 * float64(memory.Allowed()))
})
return maxIndexBlockCacheSize
}