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

Fixing search.maxUniqueTimeseries Exceeded Errors

Wide Grafana template-variable queries like {namespace=~".*"} hit the default -search.maxUniqueTimeseries=300000 guardrail and return HTTP 422 errors.

Measured TSDB & Cardinality Telemetry

VictoriaMetrics intentionally caps how many unique time series a single MetricsQL query can touch (-search.maxUniqueTimeseries, default 300,000) to protect small 2-4 GB nodes from accidental full-DB regex scans. When legitimate 1.5M-15M series fleets run global rollups, this limit must scale proportionally with node RAM.

Subsystem / SignalMeasured FootprintOperational Impact
Default Guardrail Limit300,000 series/queryTriggers 422 on global cluster dashboards
2-4 GB VPS Safe Cap750,000 - 1,500,000Pairs safely with -memory.allowedPercent=60
8-16 GB VPS Safe Cap3,000,000 - 8,000,000Supports fleet-wide multi-cluster heatmaps

Step-by-Step Diagnostic & Config Remediation

  1. Verify exact 422 error message: Check Grafana query inspector for "the number of matching unique timeseries exceeds 300000".
  2. Tighten Grafana variable filters: Filter by cluster or environment label before wildcarding pod metrics.
  3. Scale -search.maxUniqueTimeseries: Raise the flag to ~1.4x active series on adequately sized 4-16 GB RAM nodes.
# Adjust in victoriametrics.service or docker-compose.yml:
-search.maxUniqueTimeseries=1500000
-search.maxSamplesPerSeries=30000000
-search.maxConcurrentRequests=16

Diagnostic FAQ

Why not set -search.maxUniqueTimeseries to 100 million?

An unindexed wildcard query touching millions of series concurrently will exhaust RAM and stall ingestion; always bound it near 1.2x-1.5x your real active series.

Can I enforce recording rules instead of raising the query cap?

Yes. Using vmalert recording rules pre-aggregates heavy global metrics so Grafana reads dozens of series instead of millions.

Related Prometheus & TSDB Errors Guides

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