From d21cc2d16a6123c939a515b1a36aabb4c1a87964 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 17 Jan 2020 16:27:16 +0200 Subject: [PATCH] app/vmselect/netstorage: limit the maximum size for in-memory buffer for temporary blocks file This should reduce memory usage on systems with more than 8GB RAM. --- app/vmselect/netstorage/tmp_blocks_file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/vmselect/netstorage/tmp_blocks_file.go b/app/vmselect/netstorage/tmp_blocks_file.go index 3667d12b43..9f6f072ed3 100644 --- a/app/vmselect/netstorage/tmp_blocks_file.go +++ b/app/vmselect/netstorage/tmp_blocks_file.go @@ -36,6 +36,9 @@ func maxInmemoryTmpBlocksFile() int { if maxLen < 64*1024 { return 64 * 1024 } + if maxLen > 4*1024*1024 { + return 4*1024*1024 + } return maxLen }