Skip to main content
READY SERIESSTORE LAB // PROMETHEUS OOM VS VICTORIAMETRICS TSDB BASELINE: 2026-11-11 | TARGET: 0.8-1.3 KB/SERIES | 0.4-0.9 B/SAMPLE ZSTD
VictoriaMetrics
VictoriaMetrics Disclosure: Outbound /go/ links marked rel="sponsored" may earn a partner commission at zero checkout cost (Disclosures).
Prometheus & TSDB Errors // SeriesStore Lab

Grafana Dashboard Slow Range-Query & 504 Timeouts

Querying 30-day or 6-month rate() windows across millions of active series stalls Prometheus block iterators and triggers Grafana 504 Gateway Timeouts.

Measured TSDB & Cardinality Telemetry

Long-range PromQL queries touch hundreds of fragmented 2-hour Prometheus TSDB blocks and uncached postings lists. VictoriaMetrics stores time-ordered columnar blocks compressed with Gorilla + ZSTD and caches rollup responses so multi-month Grafana panels load 5x-15x faster.

Subsystem / SignalMeasured FootprintOperational Impact
30-Day 1M Series Query (Prometheus)14.5 - 42.0 secondsFrequently hits Grafana 30s dataproxy timeout
30-Day 1M Series Query (VictoriaMetrics)0.7 - 2.4 secondsCached in rollupResultCache & IndexDB
Recommended Cache Allocation-memory.allowedPercent=65Reserves 65% host RAM for hot index and block caches

Step-by-Step Diagnostic & Config Remediation

  1. Inspect slow queries in vmui /metrics: Check vm_slow_queries_total and query duration histograms on port 8428.
  2. Raise -memory.allowedPercent to 65: Dedicate 65% of dedicated node RAM to VictoriaMetrics caches when running standalone.
  3. Cap runaway regex fan-outs: Set -search.maxUniqueTimeseries and use NVMe storage like Vultr HF for random block seeks.
curl -s http://127.0.0.1:8428/metrics | grep -E "vm_cache_size_bytes|vm_slow_queries"
# Tune flags in victoriametrics.service:
-memory.allowedPercent=65
-search.maxQueryDuration=30s
-search.maxUniqueTimeseries=1500000

Diagnostic FAQ

Why does -memory.allowedPercent default to 60%?

Leaving 40% free RAM allows the Linux kernel OS page cache to hold hot compressed data files without forcing swap.

Does MetricsQL work with existing Grafana Prometheus datasources?

Yes. Point Grafana Prometheus datasource directly at http://host:8428 and all PromQL dashboards work unmodified.

Related Prometheus & TSDB Errors Guides

VictoriaMetrics: Cut Prometheus OOM RAM 80%+ on InterServer $6/TB Slice Launch Vultr HF