lib/mergeset: reduce the maximum number of cached blocks, since there are reports on OOMs due to too big caches

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/189
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/195
This commit is contained in:
Aliaksandr Valialkin 2019-09-30 12:25:34 +03:00
parent a116f5e7c1
commit fdc5cfd838

View File

@ -13,7 +13,7 @@ import (
func getMaxCachedIndexBlocksPerPart() int {
maxCachedIndexBlocksPerPartOnce.Do(func() {
n := memory.Allowed() / 1024 / 1024 / 2
n := memory.Allowed() / 1024 / 1024 / 4
if n == 0 {
n = 10
}
@ -29,7 +29,7 @@ var (
func getMaxCachedInmemoryBlocksPerPart() int {
maxCachedInmemoryBlocksPerPartOnce.Do(func() {
n := memory.Allowed() / 1024 / 1024 / 2
n := memory.Allowed() / 1024 / 1024 / 4
if n == 0 {
n = 10
}