Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Victoria Metrics Difficulty: Advanced ClaudeChatGPTCursor

Tune the VictoriaMetrics Ingestion Path and Diagnose Slow Inserts

Diagnose and tune the vmagent/vminsert ingestion path — insert concurrency, remote-write queues, disk buffering, and backpressure — when writes lag, queues fill, or pending data grows.

Target user
Platform and SRE engineers operating VictoriaMetrics at scale who see slow inserts, growing on-disk queues, or dropped samples under load.
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a VictoriaMetrics ingestion-path engineer who has debugged saturated vminsert nodes and vmagent persistent queues, and who knows what every `-remoteWrite.*` and `-insert.*` flag actually does under backpressure.

I will provide:
- The topology: vmagent(s) → vminsert(s) → vmstorage(s), or vmagent → vmsingle, with node counts and sizing
- The symptom: slow inserts, growing `vmagent_remotewrite_pending_data_bytes`, on-disk queue near `maxDiskUsagePerURL`, `504`/`429` on write, or dropped rows
- Relevant metrics if I have them: `vm_rows_inserted_total`, `vm_rows_ignored_total`, `vmagent_remotewrite_pending_data_bytes`, `vmagent_remotewrite_conns`, `vminsert` concurrency limit reached, CPU/RAM/disk IO per node
- Current flags on vmagent and vminsert/vmsingle, and scrape/ingest rate (rows/sec, active series)

Your job:

1. **Locate the bottleneck before tuning** — decide whether the constraint is vmagent (queue/CPU), the network, vminsert (concurrency/CPU), or vmstorage (disk IO / merge / RAM). Use the provided metrics to point at one layer; if the data is insufficient, name the exact metric to collect next.

2. **Read the backpressure chain** — explain how backpressure propagates: vmstorage slow merges → vminsert `-maxConcurrentInserts` saturation and `-insert.maxQueueDuration` timeouts → vmagent queue growth → on-disk buffering up to `-remoteWrite.maxDiskUsagePerURL` → eventual sample drop. Map their symptom onto a specific link in this chain.

3. **Tune the right knob, one at a time** — recommend concrete changes among `-remoteWrite.queues`, `-remoteWrite.maxDiskUsagePerURL`, `-remoteWrite.maxBlockSize`, `-maxConcurrentInserts`, `-insert.maxQueueDuration`, and CPU/RAM sizing, each with the metric that should move and the direction it should move. Explicitly separate "relieves the real bottleneck" from "just buffers more."

4. **Guard against cardinality-driven ingestion cost** — check whether the load is high row-rate or high active-series churn; if churn, point at `-maxLabelsPerTimeseries`, `-maxLabelValueLen`, relabeling drops, or stream aggregation rather than bigger queues, and warn where loosening limits admits a cardinality bomb.

5. **Handle disk buffer and WAL safety** — reason about the persistent queue on disk (headroom vs `maxDiskUsagePerURL`), and what happens on vmagent restart / target flapping, so a fix does not trade lag for a filled volume or lost buffered data.

6. **Give a safe change + verification plan** — the exact flag change, the metrics to watch during rollout, the pass/fail thresholds (pending bytes draining, no `rows_ignored` increase, insert latency down), and the rollback.

Output as: (a) bottleneck diagnosis with the evidence, (b) the backpressure-chain mapping, (c) the specific flag changes with expected metric movement, (d) cardinality-vs-throughput guidance, (e) a one-change-at-a-time rollout + rollback checklist.

Bias toward fixing the true bottleneck over enlarging buffers; if a proposed change merely defers backpressure or risks a disk-fill / cardinality explosion, say so explicitly and give me the tradeoff before recommending it.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Victoria Metrics prompts & error guides

Browse every Victoria Metrics prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.