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 483af3a97a
commit 9fce611fbb

View file

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