VictoriaMetrics Tuning Fixes // SeriesStore Lab
Optimizing MetricsQL & Rollup Query Caches
Understanding -search.latencyOffset and rollupResultCache prevents stale tail-window queries from busting VictoriaMetrics cache on every 5-second dashboard refresh.
Measured TSDB & Cardinality Telemetry
When Grafana refreshes an auto-refreshing panel every 5 seconds, querying up to "now" forces re-evaluation of unsealed recent blocks. Keeping -search.latencyOffset=30s (default) ensures recent scrapes settle cleanly and repeated Grafana views hit cached rollup series in milliseconds.
| Subsystem / Signal | Measured Footprint | Operational Impact |
|---|---|---|
| Rollup Cache Hit Latency | 4 - 25 ms | Instant Grafana dashboard rendering |
| Default Latency Offset | 30s (safe buffer) | Prevents partial-scrape jitter at graph right edge |
| Max Concurrent Queries | -search.maxConcurrentRequests=16 | Protects ingestion latency under dashboard storms |
Step-by-Step Diagnostic & Config Remediation
- Inspect cache hit ratio: Query rate(vm_cache_requests_total[5m]) vs vm_cache_misses_total for rollupResult.
- Avoid lowering latencyOffset below 15s: Keeping offset >= scrape_interval avoids false zero drops at the right edge of panels.
- Tune maxConcurrentRequests to vCPU: Set 2x-4x vCPU count on Vultr High Frequency or InterServer KVM nodes.
# Query cache safety flags for 4-8 vCPU nodes: -search.latencyOffset=30s -search.maxConcurrentRequests=16 -search.maxQueueDuration=10s
Diagnostic FAQ
Why does the last 30 seconds of a Grafana graph sometimes look flat?
Because -search.latencyOffset=30s delays querying the active tail slightly so all distributed scrapers finish committing points.
Can I disable the response cache for debugging?
Pass nocache=1 as a query parameter on /api/v1/query_range during diagnostic benchmarks.