VictoriaMetrics Tuning Fixes // SeriesStore Lab
Tuning -memory.allowedPercent for Zero-OOM Stability
Unlike Prometheus unbounded head allocations, VictoriaMetrics scales its internal IndexDB and block caches strictly inside -memory.allowedPercent of host RAM.
Measured TSDB & Cardinality Telemetry
Setting -memory.allowedPercent=60 reserves 60% of host RAM for VictoriaMetrics Go heap and off-heap caches while leaving 40% for the Linux kernel page cache, SSH, and Grafana. On dedicated 8-16 GB nodes, raising this to 65% speeds up high-churn IndexDB lookups.
| Subsystem / Signal | Measured Footprint | Operational Impact |
|---|---|---|
| Shared VPS (Prom + Grafana + VM) | -memory.allowedPercent=50 | Leaves 50% RAM for Grafana & OS page cache |
| Dedicated VM Node (2-8 GB) | -memory.allowedPercent=60 | Balanced IndexDB cache vs Linux disk cache |
| High-Query Dedicated (8-16+ GB) | -memory.allowedPercent=65 | Maximizes hot series lookup cache hit rate |
Step-by-Step Diagnostic & Config Remediation
- Check co-located services on host: If Grafana or Alertmanager shares the same VPS, lower allowedPercent to 50%.
- Set explicit Go memory soft limit: Pair -memory.allowedPercent with container mem_limit if running under Docker Compose.
- Verify cache hit ratio: Monitor vm_cache_requests_total vs vm_cache_misses_total on :8428/metrics.
# Dedicated VictoriaMetrics node: -memory.allowedPercent=65 # Co-located with Grafana + vmalert on 4 GB VPS: -memory.allowedPercent=50
Diagnostic FAQ
What happens inside Docker if cgroup mem_limit is lower than host RAM?
VictoriaMetrics automatically reads cgroup v1/v2 memory limits when calculating -memory.allowedPercent.
Can I set -memory.allowedPercent=90?
Avoid setting above 70%; Linux needs free RAM for kernel filesystem page cache to keep ZSTD disk reads fast.