From 56b08390f626d8bbebe50528195263d40607004f Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 12 May 2021 14:42:38 +0300 Subject: [PATCH] app/vmselect/promql: allow to use 2x more memory for query processing in cluster mode compared to single-node mode `vmselect` has no `vmstorage`-related caches. So it can use more memory for query processing compared to single-node VictoriaMetrics. --- app/vmselect/promql/eval.go | 2 +- app/vmselect/promql/rollup_result_cache.go | 2 +- docs/CHANGELOG.md | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/vmselect/promql/eval.go b/app/vmselect/promql/eval.go index c720f16ce..dce8fe9b8 100644 --- a/app/vmselect/promql/eval.go +++ b/app/vmselect/promql/eval.go @@ -795,7 +795,7 @@ var ( func getRollupMemoryLimiter() *memoryLimiter { rollupMemoryLimiterOnce.Do(func() { - rollupMemoryLimiter.MaxSize = uint64(memory.Allowed()) / 4 + rollupMemoryLimiter.MaxSize = uint64(memory.Allowed()) / 2 }) return &rollupMemoryLimiter } diff --git a/app/vmselect/promql/rollup_result_cache.go b/app/vmselect/promql/rollup_result_cache.go index 492a005cc..91e7e31c2 100644 --- a/app/vmselect/promql/rollup_result_cache.go +++ b/app/vmselect/promql/rollup_result_cache.go @@ -34,7 +34,7 @@ var rollupResultCachePath string func getRollupResultCacheSize() int { rollupResultCacheSizeOnce.Do(func() { - n := memory.Allowed() / 16 + n := memory.Allowed() / 8 if n <= 0 { n = 1024 * 1024 } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 32ea4b5dc..2b5e43186 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,7 @@ sort: 15 * FEATURE: vmalert: add flag to control behaviour on startup for state restore errors. Such errors were returned and logged before as well. But now user can specify whether to just log these errors (`-remoteRead.ignoreRestoreErrors=true`) or to stop the process (`-remoteRead.ignoreRestoreErrors=false`). The latter is important when VM isn't ready yet to serve queries from vmalert and it needs to wait. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1252). * FEATURE: vmalert: add ability to pass `round_digits` query arg to datasource via `-datasource.roundDigits` command-line flag. This can be used for limiting the number of decimal digits after the point in recording rule results. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/525). * FEATURE: return `X-Server-Hostname` header in http responses of all the VictoriaMetrics components. This should simplify tracing the origin server behind a load balancer or behind auth proxy during troubleshooting. +* FEATURE: vmselect: allow to use 2x more memory for query processing at `vmselect` nodes in [VictoriaMetrics cluster](https://docs.victoriametrics.com/Cluster-VictoriaMetrics.html). This should allow processing heavy queries without the need to increase RAM size at `vmselect` nodes. * BUGFIX: vmagent: fix possible race when refreshing `role: endpoints` and `role: endpointslices` scrape targets in `kubernetes_sd_config`. Prevoiusly `pod` objects could be updated after the related `endpoints` object update. This could lead to missing scrape targets. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1240). * BUGFIX: properly remove stale parts outside the configured retention if `-retentionPeriod` is smaller than one month. Previously stale parts could remain active for up to a month after they go outside the retention.