Skip to main content

Generated by go run ./cmd/configdoc from the flags in cmd/proxy/main.go and the registry in internal/config. Do not edit by hand.

Limits registry

Every operator-tunable bound on the work one request may do. A limit is never a silent truncation: hitting one returns an error with Loki's text for the limit's class, and the request error log line names the flag (limit_flag), so an operator can raise it. Zero selects the built-in default of each flag; startup rejects negative values.

Fleet arithmetic: per-replica limits multiply by the replica count, and every byte limit multiplies by the requests that hold a response at once (-max-concurrent).

LimitFlagHelm valueDefaultUnitBoundsError when hitMetricAlertPer tenantLoki parity
backend max concurrent heavy queries-backend-max-concurrent-heavy-queriesextraArgs.backend-max-concurrent-heavy-queries2concurrent callsheavy VictoriaLogs calls running at once per replica: raw-row metric fetches above 10,000 rows, and stats, hits or unbounded query calls spanning at least -backend-heavy-query-min-range, finer than 11,000 buckets, or without a time range429 too many outstanding requests (Loki's text, with no flag in it); the request error log line names the flag as limit_flag=-backend-max-concurrent-heavy-queries with its value as limit_value, and its upstream_error says heavy VictoriaLogs queries are limited to -backend-max-concurrent-heavy-queries=N per replica and this query waited -backend-heavy-query-queue-wait=Dloki_vl_proxy_internal_operation_total{operation="backend_heavy_query_admission"}nonenoquerier.max_concurrent / the query scheduler queue (Loki answers a full queue with the same 429 message)
backend max concurrent metadata scans-backend-max-concurrent-metadata-scansextraArgs.backend-max-concurrent-metadata-scans8concurrent callsthe ceiling of the adaptive limit on long-range VictoriaLogs metadata scans running at once per replica: stream_field_names, stream_field_values, field_names, field_values and streams calls spanning at least -backend-heavy-query-min-range or without a time range (the /labels, /label/{name}/values, /series and detected_fields scans), and the day bucket scans of such a listing when it is assembled from the metadata inventory (each holds a slot only while its own call runs; hour buckets are short scans like any short listing). Shorter listings, inventory edges, minute buckets and row counts are never queued. The selects VictoriaLogs runs for others (other replicas, other clients, read from its /metrics) count against the limit, so replicas that never talk to each other hold VictoriaLogs near one replica's limit rather than replicas x limit. The limit starts at 2, grows by 1/limit per scan that used the whole limit within -backend-metadata-scan-latency-tolerance of its no-load duration, shrinks by 20% once per wave of slower scans, halves on a transport failure, timeout or 5xx and on a rise of VictoriaLogs' queue-timeout counter, and never exceeds this value or drops below -backend-min-concurrent-metadata-scans. Independently of the limit, no scan starts while VictoriaLogs runs all its select slots, stops answering /metrics, or lacks the memory headroom (-backend-metadata-scan-memory-headroom)429 too many outstanding requests (Loki's text, with no flag in it); the request error log line names the flag as limit_flag=-backend-max-concurrent-metadata-scans with its value as limit_value, and its upstream_error says long-range VictoriaLogs metadata scans are limited to at most -backend-max-concurrent-metadata-scans=N per replica (adaptive limit L, floor -backend-min-concurrent-metadata-scans=F[, VictoriaLogs running C of S selects][, VictoriaLogs /metrics not answering][, VictoriaLogs memory P% used with R% reserved by this replica's scans against -backend-metadata-scan-memory-headroom=H]) and this query waited -backend-heavy-query-queue-wait=D; a background inventory refresh that finds the limiter closed is skipped (outcome skipped) and retried on its next schedule insteadloki_vl_proxy_internal_operation_total{operation="backend_metadata_scan_admission"}nonenoquerier.max_concurrent / the query scheduler queue (Loki answers a full queue with the same 429 message); Loki serves /labels from its index in milliseconds, VictoriaLogs scans every row in the range
backend min concurrent metadata scans-backend-min-concurrent-metadata-scansextraArgs.backend-min-concurrent-metadata-scans1concurrent callsthe floor of the adaptive limit on long-range metadata scans per replica: latency and failure feedback never shrink the limit below it, and below it a replica may start a scan while other clients' long work uses up to a quarter of VictoriaLogs' select slots (the fleet share otherwise counts it against the limit). VictoriaLogs' full select slots, its memory headroom, a /metrics that stopped answering (for up to 10 s), and for a listing never measured any other select running, still hold scans backnone directly; it bounds how far -backend-max-concurrent-metadata-scans may adapt downloki_vl_proxy_internal_operation_total{operation="backend_metadata_scan_admission"}nonenoproxy-specific
backend metadata scan memory headroom-backend-metadata-scan-memory-headroomextraArgs.backend-metadata-scan-memory-headroom0.4fractionthe share of the memory available to VictoriaLogs that long-range metadata scans must leave free. The proxy reads VictoriaLogs' /metrics (process_resident_memory_anon_bytes, or process_resident_memory_bytes, vm_available_memory_bytes, vl_concurrent_select_current and _capacity; about 40 KB, at most every 100 ms while scans are admitted and every 500 ms while they run) and admits a scan only while the memory in use (the anonymous resident set minus the Go heap VictoriaLogs has freed but not returned, go_memstats_heap_idle_bytes - go_memstats_heap_released_bytes), plus what this replica's scans in flight reserved and have not yet shown in it, plus the selects VictoriaLogs runs for others counted at this scan's cost (another replica's scan that started a moment ago holds none of its memory yet), plus the scan's own cost stays below 1 minus this fraction of the available memory. The cost is learned per endpoint, range bucket and tenant from the peak growth of the memory in use while a scan ran. A listing a tenant has not scanned over this range borrows the same listing's cost over another range (scaled up from a shorter one) or twice another tenant's; a listing nobody has measured runs alone: only while VictoriaLogs runs no other select and this replica no other unmeasured scan. The only scan on an idle VictoriaLogs may use the headroom up to the brake mark. On a VictoriaLogs where some select always runs, a synchronous request whose listing has no cost measured alone goes ahead after waiting 2-4 s, once memory in use held steady for 5 s and no select started during its wait, reserving more than half the room left, so such escapes go one at a time. Behind the estimates is a brake: when memory in use passes a third of the way into the headroom (73% of the available memory at 0.4) a replica stops its youngest scan, one every 500 ms while it stays above, and that request gets the 429; what the stopped scan had grown to becomes its class's cost, so the class is not started again for an hour unless it fits below the markthe same 429 as -backend-max-concurrent-metadata-scans, with the memory figures in the log line; background refreshes skiploki_vl_proxy_internal_operation_total{operation="backend_metadata_scan_admission"}nonenoproxy-specific
backend metadata scan latency tolerance-backend-metadata-scan-latency-toleranceextraArgs.backend-metadata-scan-latency-tolerance1.5ratiohow many times its no-load duration a long-range metadata scan that ran beside others may take before the adaptive limit shrinks by 20%. The no-load duration is tracked per endpoint, range bucket and tenant the way Vegas tracks the base round-trip time: a faster scan lowers it at once, slower ones raise it slowly, so it follows data growth; it is kept per row when the scan's rows are known (counted inventory buckets), so a busy day is not compared with a quiet onenone directly; it decides when -backend-max-concurrent-metadata-scans adapts downloki_vl_proxy_internal_operation_total{operation="backend_metadata_scan_admission"}nonenoproxy-specific
metadata inventory parallelism-metadata-inventory-parallelismextraArgs.metadata-inventory-parallelism4concurrent callsbucket listings one /labels, /label/{name}/values or field-name listing may have in flight while it is assembled from the time-bucketed metadata inventory (UTC-aligned day, hour, 5-minute and minute buckets cached in memory, on disk and on the owner peer; the last minute is never cached; a missing hour or day is merged from its cached children first; hour and day buckets of a query made of stream and field filters are revalidated by a row count instead of a rescan). The answer is the answer of one full-range call: values are unioned, hits summed and ordered like VictoriaLogs; a listing with a limit, or a query that is not row-local (stats, uniq, limit, sort, subqueries, _time filters), is one full-range callnone; a failed bucket fails the listing (the endpoint then serves its last known-good answer or the error), never a partial listloki_vl_proxy_internal_operation_total{operation="metadata_inventory"} (outcome cached, revalidated, partial or scanned)nonenoproxy-specific
max stats cache freshness-max-stats-cache-freshnessextraArgs.max-stats-cache-freshness10m0sdurationwhich part of an instant /index/volume is read from VictoriaLogs on every request: a volume over at least 10 minutes whose stats query is row-local and not limited by VictoriaLogs is summed per VictoriaLogs stats row from UTC-aligned day, hour, 5-minute and minute segments (at most 1000 per request); segments that end before now minus this duration are kept in the read cache (memory, disk and the owner peer, re-read on the metadata inventory's age schedule over the labels TTL) and the edges, including everything newer, are read live. Missing segments of one level that follow each other are read by one stats_query_range call; at most -metadata-inventory-parallelism reads run at once. The answer is the answer of one whole-window call: rows are summed, then named, limited and ordered as beforenone; a failed read fails the request as the whole-window call would, and a segment larger than the cache entry size, segment rows of one request beyond -backend-max-buffered-response-bytes, a response over it or a rejected optimised query answers the request with one whole-window callloki_vl_proxy_internal_operation_total{operation="volume_segments"} (outcome cached, partial, scanned or whole_window)nonenomax_stats_cache_freshness (default 10m, https://grafana.com/docs/loki/latest/configure/): Loki does not cache a volume whose end falls within it of now
peer replication factor-peer-replication-factorextraArgs.peer-replication-factor2replicasreplicas of every peer-cache key, owner included (1-5): the key's owner on the peer ring and the next distinct peers clockwise; a write-through write is pushed to each replica other than the writer, which keeps the copy in memory and on disk; a lookup that misses memory and disk asks the replicas in ring order, each for at most -peer-timeoutnone; a value out of 1-5 is clamped to that range; a key no replica holds is computed as beforeloki_vl_proxy_peer_cache_replication_factor; loki_vl_proxy_peer_cache_backup_hits_total; loki_vl_proxy_peer_cache_write_through_pushes_total, loki_vl_proxy_peer_cache_write_through_errors_total, loki_vl_proxy_peer_cache_push_too_large_total; loki_vl_proxy_cache_tier_hits_total{tier="l3_peer"}nonenoproxy-specific
peer read hedge max delay-peer-read-hedge-max-delayextraArgs.peer-read-hedge-max-delay200msdurationhow long a peer-cache read waits on one replica's response headers: a lookup that misses memory and disk asks the key's replicas in ring order, and when the replica asked last has not answered within the hedge delay it also asks the next replica and takes the first answer, or, with no replica left, goes on as a miss (the request reads VictoriaLogs or computes the entry). The call it stopped waiting for finishes in the background, where -peer-timeout still suspends a paused or hung peer for the breaker cooldown, and until it ends reads skip that peer, so one read per proxy pays the delay. The delay is twice the p99 of the peer header latencies this proxy measured (a decaying histogram), at least 5 ms and at most this value and half of -peer-timeout; until 64 latencies are measured it is the maximum. The /patterns owner presence check is bounded the same waynone; a hedged read is a peer read like any other, and one that goes on as a miss is answered from VictoriaLogs as before peers existedloki_vl_proxy_peer_cache_read_hedges_total{action="next_replica"|"gave_up"}; loki_vl_proxy_peer_cache_read_hedge_delay_seconds; loki_vl_proxy_peer_cache_fetch_duration_seconds; peer error reason peer_slownonenoproxy-specific
peer push buffer max entries-peer-push-buffer-max-entriesextraArgs.peer-push-buffer-max-entries8192pusheswrite-through pushes one proxy keeps, across all its peers, while a peer cannot take them: its breaker is open or it is suspended after a timeout, it has not answered since this process started, the push queue is full (4,096 pushes or 64 MiB behind 64 running), or the push failed with a transport error, a timeout, a 429 or a 5xx. Each peer's backlog is FIFO and keeps one entry per key, the newest value; while a peer has a backlog every new push to it joins it, so an older value never lands after a newer one. One replayer per peer sends the backlog once the peer's breaker lets a call through: one push first (the half-open probe), then rounds doubling from 1 to 32 pushes, at most 8 in flight, 10 ms apart; a failed round goes back to the front and waits 250 ms doubling to 10 s, jittered. Each push is sent with the TTL the writer's copy has left, and one with under 5 s left is not sent. Reads never wait for it: a lookup skips a peer whose breaker is open and asks the next replica or VictoriaLogsnone; above the bound the oldest push of the largest backlog is dropped (loki_vl_proxy_peer_cache_push_buffer_dropped_total{reason="full"}) with one warning log line at most every 30 s naming this flag, and the replica that misses it fetches the key from another replica or VictoriaLogs on first lookuploki_vl_proxy_peer_cache_push_buffered_total{reason}; loki_vl_proxy_peer_cache_push_replayed_total; loki_vl_proxy_peer_cache_push_buffer_coalesced_total; loki_vl_proxy_peer_cache_push_buffer_dropped_total{reason}; loki_vl_proxy_peer_cache_push_buffer_entries; loki_vl_proxy_peer_cache_push_buffer_bytesnonenoproxy-specific
peer push buffer max bytes-peer-push-buffer-max-bytesextraArgs.peer-push-buffer-max-bytes33554432bytesbytes of the values in the peer push buffer (-peer-push-buffer-max-entries), across all peers of one proxynone; above the bound the oldest push of the largest backlog is dropped (loki_vl_proxy_peer_cache_push_buffer_dropped_total{reason="full"}), with the same rate-limited warningloki_vl_proxy_peer_cache_push_buffer_bytes; loki_vl_proxy_peer_cache_push_buffer_dropped_total{reason}nonenoproxy-specific
backend heavy query queue wait-backend-heavy-query-queue-waitextraArgs.backend-heavy-query-queue-wait20sdurationhow long the heavy calls of one request wait, together, for heavy-query slots, and how long each long-range metadata scan of a request (one listing, or one day bucket of the label inventory, all of a request's bucket scans together at most twice this) waits for a metadata-scan slot; the adaptive metadata limiter re-reads VictoriaLogs' /metrics every 250 ms while a scan waits, and the request context bounds the whole429 too many outstanding requests (Loki's text, with no flag in it); the log line names the flag that closed the door as limit_flagloki_vl_proxy_internal_operation_duration_seconds{operation="backend_heavy_query_admission"}nonenoproxy-specific
backend heavy query min range-backend-heavy-query-min-rangeextraArgs.backend-heavy-query-min-range6h0m0sdurationthe time range from which stats, hits and unbounded raw calls count as heavy, and metadata listings count as long-range scansnone directly; it selects which calls the two admission limiters governloki_vl_proxy_internal_operation_total{operation="backend_heavy_query_admission"}nonenoproxy-specific
manual range metric row limit-manual-range-metric-row-limitextraArgs.manual-range-metric-row-limit1000000rowsrows one proxy-side range-metric evaluation reads: raw log rows, or stats rows (one per non-empty step bucket and series) per bucket grid on the window stats path. On a range longer than the step over an extraction list's series identity (sum(max_over_time({...} | logfmt amount, user_id | unwrap amount [5m]))), it bounds one time chunk's read instead (its series before the fold; the tenant's max_query_series when that is larger; the chunk's stats body is also held under 64 MiB): the request is read in chunks of steps sized under both, each with the range before it, and folded chunk by chunk, so a long range over a listed label of many values answers Loki's values with the proxy holding one chunk at a time400 limit reached while evaluating the query (the class of Loki's query limits; Loki has no equivalent flag, so the text carries none); the request error log line names limit_flag=-manual-range-metric-row-limit and limit_value, and its upstream_error says manual range metric row limit exceeded (N); narrow the query or increase -manual-range-metric-row-limit, with ; the query matches M log lines for the count precheck and (N stats rows in one bucket grid) for the window stats path. The same answer covers a without aggregation, which reads a series per stream before it folds them, when it holds more series than this limit and the limit is not below the tenant's effective max_query_series (-max-stats-query-series, or the tenant's own override; below it, that series limit is the bound and Loki's series message answers); its upstream_error says metric result over the raw-row budget of a request that folds its series; narrow the query or increase -manual-range-metric-row-limit. On the chunked extraction-list windows only a single step whose window holds more series than this limit answers it, with (N series in the window of one step); a single step whose stats pass the 64 MiB body bound answers Loki's message-size error (500 ResourceExhausted, the log line naming -backend-max-buffered-response-bytes)loki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsnoproxy-specific
error cache transient ttl-error-cache-transient-ttlextraArgs.error-cache-transient-ttl1sdurationhow long a read request's backend failure is held and answered again, byte for byte, to identical requests (same tenant, credentials, response profile and parameters) on this replica: VictoriaLogs 5xx, 429 or queue timeout, a refused or reset connection (a timeout or a body VictoriaLogs aborted is never held: a retry may answer). A 5xx, 429 or refused or reset connection is also held for the same request with any start, end, time or since. Identical requests that arrive while the first one runs wait for it and share its failure whatever this TTL is. Held only when the request's query plan reads data; never pushed to peersnone of its own: the held answer is Loki's answer for the failure (500 Internal Server Error, 504, 429 as Loki answers them)loki_vl_proxy_error_cache_hits_total{class="transient"}, loki_vl_proxy_error_coalesced_total{class="transient"}nonenoproxy-specific
error cache data ttl-error-cache-data-ttlextraArgs.error-cache-data-ttl5sdurationhow long a failure read from the data in the request's window is held: Loki's series limit, a line or response size limit, and under a metric whose plan has a parser error that reaches it or an unwrap conversion, the JSON parser or conversion error. Never pushed to peersnone of its own: the held answer is the request's Loki error (400 series limit, 400 pipeline error, 500 message size)loki_vl_proxy_error_cache_hits_total{class="data"}, loki_vl_proxy_error_coalesced_total{class="data"}nonenoproxy-specific
error cache vl refusal ttl-error-cache-vl-refusal-ttlextraArgs.error-cache-vl-refusal-ttl5m0sdurationhow long VictoriaLogs' refusal of the query the proxy wrote is held: a refusal VictoriaLogs gives before reading any data and gives the same text every time on the same release (a parse error, a stats shape it does not run, a query or extra_filters arg over its -search.maxQueryLen), answered by VictoriaLogs or predicted from the detected release (-vl-refusal-prediction). Held for the request; a parse or stats shape refusal also for every window of its query (a refresh that moves end=now is refused the same way), an argument or length refusal for the exact request only, keyed by tenant, credentials, response profile, configuration epoch and VictoriaLogs release, so a reload or a release change asks again. At 30s or more a refusal VictoriaLogs answered is pushed to every peer (-error-cache-peer-sync); a peer holds it only for the same proxy build, VictoriaLogs release and routing configuration, for the rest of the hold plus up to 15% so one replica asks again firstnone of its own: the held answer is Loki's answer for the refusal (500 Internal Server Error for a refused plan, or the fallback route's answer)loki_vl_proxy_error_cache_hits_total{class="vl_refusal"}, loki_vl_proxy_error_cache_peer_sync_total, loki_vl_proxy_vl_refusals_predicted_totalnonenoproxy-specific
error cache max entries-error-cache-max-entriesextraArgs.error-cache-max-entries4096entriesfailed answers held per replica; the oldest is evicted first, and an expired one is dropped when it is read or when room is needed (no background goroutine)none: an evicted failure is answered again by running the requestloki_vl_proxy_error_cache_entriesnonenoproxy-specific
error cache max bytes-error-cache-max-bytesextraArgs.error-cache-max-bytes8388608bytesbytes of failed answers held per replica (body, key and headers); one answer above 64 KiB is neither held nor sharednone: an evicted failure is answered again by running the requestloki_vl_proxy_error_cache_bytesnonenoproxy-specific
max stats query series-max-stats-query-seriesextraArgs.max-stats-query-series0seriesseries in the result of a metric query, on every metric route, range and instant; per tenant as max_query_series in -tenant-limits and -tenant-default-limits, published on /loki/api/v1/drilldown-limits and /config/tenant/v1/limits400 maximum number of series (N) reached for a single query; consider reducing query cardinality ... (Loki's text); a Logs Drilldown request gets 200 with N series (chosen by -drilldown-series-limit-mode) and the warning maximum number of series (N) reached for a single query; returning partial resultsloki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsyes (-tenant-limits)max_query_series (Loki's default is 500; the proxy's built-in default is 1000, a documented difference: the proxy answers faster than Loki, so it affords more series per query; set 500 to match Loki); a multi-tenant request is held to the smallest of its tenants
drilldown series limit mode-drilldown-series-limit-modeextraArgs.drilldown-series-limit-mode"loki"modewhich series a Logs Drilldown range answer over the series limit (-max-stats-query-series, or the tenant's max_query_series) keeps and how far it reaches: loki or busiest; instant answers keep the busiest series in both modesnone: a Drilldown request over the limit always gets 200 with Loki's warning maximum number of series (N) reached for a single query; returning partial results; loki keeps, per split of -drilldown-series-limit-split-interval, the series met first, ending at the step where the series met so far pass the limit; busiest returns the busiest series over the whole rangenonenonenoloki is deployed Loki's answer (its query frontend splits the request by split_queries_by_interval and its engine stops each split at the step where the series met so far pass max_query_series, keeping the series it met first; recorded with the Loki engine oracle, Loki 3.7.9 and 3.7.10, and on a Loki 3.7.10 stack); busiest is a proxy choice
drilldown series limit split interval-drilldown-series-limit-split-intervalextraArgs.drilldown-series-limit-split-interval1h0m0sdurationin -drilldown-series-limit-mode=loki, the split interval of Loki's query frontend a Logs Drilldown range answer over the series limit is cut by: the request splits at the multiples of the interval strictly inside it, a step on a boundary starts the later split, and each split is cut on its own; 0 cuts the request as one split; per tenant: split_queries_by_interval in -tenant-limits / -tenant-default-limitsnone: a Drilldown request over the limit gets 200 with Loki's warning; each split keeps the series met first in it, ending where the series met so far in the split pass the limit; the splits are concatenated and not limited againnonenonenosplit_queries_by_interval (limits_config, default 1h): deployed Loki's query frontend splits a range query by it and each split's answer is cut on its own (recorded on a Loki 3.7.10 stack with the results cache off: each split asked alone is its fragment of the whole answer; sharding adds no fragments); Loki's results cache can add the cut points of earlier requests, which no proxy can know
drilldown series limit instant split interval-drilldown-series-limit-instant-split-intervalextraArgs.drilldown-series-limit-instant-split-interval1h0m0sdurationin -drilldown-series-limit-mode=loki, Loki's split_instant_metric_queries_by_interval: a Logs Drilldown instant answer over the series limit whose range is longer than it keeps the limit's busiest series without the partial-result warning; 0 always warns; per tenant: split_instant_metric_queries_by_interval in -tenant-limits / -tenant-default-limitsnone: 200 with the limit's series, with Loki's warning only when the range fits one splitnonenonenosplit_instant_metric_queries_by_interval (limits_config, default 1h): recorded on a Loki 3.7.10 stack, an instant Drilldown query over the limit with a range longer than it answers the limit's series and no warning; with a shorter range, or the split off, it answers the warning; why the split answer drops it is not documented; Loki's kept set is arbitrary, so any limit series is a Loki answer
ordered json metric max bytes-ordered-json-metric-max-bytesextraArgs.ordered-json-metric-max-bytes1073741824bytesbytes the ordered JSON metric evaluator reads from the raw rows response, and the largest response it builds500 rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (N vs. LIMIT) (Loki's text for a response above its message size); the request error log line names limit_flag=-ordered-json-metric-max-bytes and limit_value, and its upstream_error says ordered JSON metric response exceeds -ordered-json-metric-max-bytes; narrow the query or increase itloki_vl_proxy_requests_total{status="500"}nonenoproxy-specific
label filter refill max pages-label-filter-refill-max-pagesextraArgs.label-filter-refill-max-pages8requestsfurther VictoriaLogs pages of at most limit rows a log query reads, in the Loki-compatible profile, when a Loki label filter on a log line key no earlier stage exposes dropped rows VictoriaLogs matched: a response reads at most (1 + N) x limit rowsnone: the page returns fewer lines than the limit when the budget is spent; 0 reads no further pagenonenonenoproxy-specific
backend max buffered response bytes-backend-max-buffered-response-bytesextraArgs.backend-max-buffered-response-bytes67108864bytesbytes read from one VictoriaLogs response the proxy buffers: stats, volume and binary-operand responses, the encoded metric result, the Drilldown field, stream and label-filter listings, and the cold backend's backward chunks (one budget for all chunks of a query); a compressed response may also decode to the larger of 256 MiB and this value500 rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (N vs. LIMIT) (Loki's text for a response above its message size; N is the size seen when the proxy stopped reading, at least LIMIT+1), for a proxy-evaluated metric, a listing, a cold chunk or a decoded body; the request error log line names limit_flag=-backend-max-buffered-response-bytes and limit_value, and its upstream_error says manual metric response exceeds -backend-max-buffered-response-bytes; narrow the query or increase it (or backend response exceeds N bytes; narrow the query or increase -backend-max-buffered-response-bytes for a listing, a cold chunk or a decoded body; binary operand response, binary encoded response and binary expression output labels name the binary evaluator's buffers the same way); limit_value is the limitloki_vl_proxy_requests_total{status="500"}nonenoproxy-specific
max entries limit per query-max-entries-limit-per-queryextraArgs.max-entries-limit-per-query10000rowslog lines a log query may ask for (Loki's max_entries_limit_per_query, per tenant in -tenant-limits and -tenant-default-limits, where 0 is unlimited); label values requests above it are capped400 max entries limit per query exceeded, limit > max_entries_limit_per_query (L > N) (Loki's text); with -max-entries-limit-per-query-cap the limit is lowered to N insteadloki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsyes (-tenant-limits)max_entries_limit_per_query (Loki's default is 5000; the proxy keeps 10000); a multi-tenant request is held to the smallest non-zero value of its tenants
label values max response bytes-label-values-max-response-bytesextraArgs.label-values-max-response-bytes67108864bytesbytes of the VictoriaLogs answer to a /loki/api/v1/label/{name}/values request: one response, or the size the merged listing would have as one response when the metadata inventory lists it from time buckets; the read stops one byte past the limit, and a rejected response is neither cached nor indexed; per tenant as label_values_max_response_bytes in -tenant-limits and -tenant-default-limits (not published: Loki has no per-tenant equivalent)500 rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (N vs. LIMIT) (Loki's querier text above grpc_server_max_send_msg_size; N is the bytes read when the proxy stopped, or the size of the merged listing when the metadata inventory lists the values from time buckets: the cap bounds the listing, not each bucket response); the request error log line names limit_flag=-label-values-max-response-bytes and limit_valueloki_vl_proxy_internal_operation_total{operation="label_values_response_cap"}noneyes (-tenant-limits)grpc_server_max_send_msg_size (dskit default 4 MiB): Loki's querier fails a larger label values response with 500 ResourceExhausted; Loki has no per-tenant limit on label values count
metadata max staleness-metadata-max-stalenessextraArgs.metadata-max-staleness10sdurationhow far behind VictoriaLogs a /labels or /label/{name}/values answer may be when the request ends within -max-metadata-cache-freshness of now and its cached answer is older than -recent-tail-refresh-max-staleness: measured from the start of the VictoriaLogs read behind the answer this replica stored for the same tenant, auth scope and window; such a request waits -metadata-edge-refresh-budget for its edge refresh, then gets that answer (header X-Proxy-Stale-Response: true, never kept by the compatibility-edge or multi-tenant caches) while the refresh completes in the background, one per cache key, within the background timeout and cancelled by shutdown. Past the bound, or with no answer read on this replica, the request waits for VictoriaLogs; requests ending earlier read settled data and are never stalenone; past the bound the request waits for VictoriaLogs, as with 0loki_vl_proxy_internal_operation_total{operation="metadata_edge_answer"} (outcome exact, stale or waited); loki_vl_proxy_internal_operation_duration_seconds{operation="metadata_edge_staleness"} (age of each stale answer, by endpoint); {operation="metadata_edge_refresh"} (background refresh duration, outcome ok or error)nonenonone: Loki lists labels from its index and ingesters and does not cache a metadata answer ending within max_metadata_cache_freshness (https://grafana.com/docs/loki/latest/configure/), so it never lags; this bound is a proxy deviation
metadata edge refresh budget-metadata-edge-refresh-budgetextraArgs.metadata-edge-refresh-budget100msdurationhow long a near-now /labels or /label/{name}/values request with an answer within -metadata-max-staleness waits for its edge refresh from VictoriaLogs before that answer is served; a refresh that finishes in time is the answernoneloki_vl_proxy_internal_operation_total{operation="metadata_edge_answer"} (exact: refreshed within the budget; stale: answered from the last answer)nonenoproxy-specific
tail.settle delay-tail.settle-delayextraArgs.tail.settle-delay5sdurationhow far behind now a live tail (/loki/api/v1/tail) reads. VictoriaLogs makes an ingested row searchable only when its rows-buffer shard flushes (shards fill round-robin and each flushes about a second after its first row, lib/logstorage/datadb.go rowsBuffer in v1.49.0 and v1.53.0; a cluster's vlinsert buffers rows again), so rows of one stream pushed in separate requests can become searchable out of order, and its live tail skips every row of a stream at or below the newest one of that stream it already sent (app/vlselect/logsql tailProcessor.getTailRows). The native and auto tails send this as VictoriaLogs' tail offset, so a read covers only rows that are already searchable and lines reach the client about this long after they are written; the polled (synthetic) tail reads this span again on every poll that did not return a full page and drops the lines it already sent, so its latency does not change. A reopened native stream starts one delay earlier and drops the lines it repeatsnone: a delay, not a refusal; a value below the time VictoriaLogs takes to make a row searchable loses that row for a native or auto tail (it never arrives), as before this flag with 0nonenonenoLoki's tail delivers every line pushed after it started, within about a second (its querier tails the ingesters); VictoriaLogs' own default tail offset is 5s for the same reason this flag exists
tail.backend retry window-tail.backend-retry-windowextraArgs.tail.backend-retry-window30sdurationhow long a live tail (/loki/api/v1/tail) keeps its websocket open while VictoriaLogs fails for a reason a retry can fix: a refused or reset connection, a timeout, a native stream that ends or breaks, a 429 or 5xx answer (also from a proxy in front of VictoriaLogs). The proxy reopens the native stream, or polls again, after a jittered exponential wait (250 ms, doubling to 5 s) and sends pings to the client meanwhile; the window runs from the first failed call, and a reopened stream ends the outage only after it stayed up 5 s or delivered a row, so a backend that accepts a call and drops it at once spends the window. A call in flight when the window ends may overrun it by up to the 5 s response-header timeout of the tail client. The reopened stream reads from the last line sent (VictoriaLogs' start_offset, a second earlier) and drops the lines it already sent, so nothing is repeated and the lines written during the outage arrive; the polled tail keeps its cursorclose frame 1011 Internal Server Error (Loki's text) once the window is spent; at once, whatever the window, for a failure no retry fixes: a row that is not JSON, a line above 1 MiB, a 4xx answer other than 429 (VictoriaLogs rejects the query) and a client that went away (no frame, the VictoriaLogs call is released). 0 closes on the first failed call. The window never changes what a client sees before the upgrade: a first probe that exceeds -backend-timeout is still answered with 504loki_vl_proxy_internal_operation_total{operation="tail_backend_retry"} (outcome retried: a wait before another attempt; recovered: the call succeeded again; exhausted: the window passed and the tail closed; permanent: closed at once) and loki_vl_proxy_internal_operation_duration_seconds{operation="tail_backend_retry"} (the wait before each attempt, and the length of an outage that ended)nonenoLoki's querier keeps a tail alive when its ingesters restart (it reconnects to them) and its tailer sends dropped_entries only for a slow client; a VictoriaLogs restart is the proxy's equivalent, so the tail survives it instead of closing. The proxy never reports a backend gap as dropped_entries: VictoriaLogs returns the rows of the gap on the reopened read, and the rows that cannot come back (written with a timestamp older than the last line sent, after it was sent) are the same ones a live tail never shows
backend retry attempts-backend-retry-attemptsextraArgs.backend-retry-attempts2retries per callhow many times one VictoriaLogs read (a query, a listing, a stats call; never the delete call or a live tail) is sent again after a failure a retry can fix: a connection refused, reset or closed before any answer, and a 429, 502, 503 or 504 answer (VictoriaLogs' queue-timeout and delayed-shutdown 503s, or a proxy in front of it). The wait doubles from 200 ms to 2 s with jitter and is at least the Retry-After a proxy in front sent (VictoriaLogs sends none). Nothing is retried after a timeout, a client cancel, once an answer body was read, while the circuit breaker is not closed, when the request deadline would pass during the wait, or for a 4xx other than 429 or a 500 (VictoriaLogs rejected or failed the query itself)none while a retry succeeds: the client gets the answer Loki would give. After the last try the error is the one without retries (Loki's 429 for a full queue, 500 for a failed backend, 499 for a cancel, 504 for a deadline); VictoriaLogs' text is only in the proxy log line VictoriaLogs call failed, retrying. 0 sends every read onceloki_vl_proxy_internal_operation_total{operation="backend_retry"} (outcome retried: a wait before another try, duration is the wait; recovered: a repeated call succeeded, duration is the time spent retrying; exhausted: tries, wait or the deadline ran out; breaker_open: the circuit breaker was not closed; budget_denied: see -backend-retry-budget-ratio)nonenoLoki's query frontend retries a failed sub-query (query_frontend.max_retries) before it answers an error; a transient VictoriaLogs failure is the proxy's equivalent, so the client sees the answer and not an error Loki would not have produced
backend retry max wait-backend-retry-max-waitextraArgs.backend-retry-max-wait5sdurationthe total time one VictoriaLogs call waits between its tries (-backend-retry-attempts). A try whose wait would pass it, or a Retry-After longer than what is left, ends the retries at once and the last answer is returned; the wait never passes the request's own deadline, and a deadline that cannot fit the wait plus a try as long as the last one ends the retries toonone directly; it bounds how long a failing call is held before the error of -backend-retry-attempts is returned. 0 disables retriesloki_vl_proxy_internal_operation_total{operation="backend_retry"} (outcome exhausted)nonenoproxy-specific
backend retry budget ratio-backend-retry-budget-ratioextraArgs.backend-retry-budget-ratio0.1retries per callthe retries a replica earns per VictoriaLogs call: every call credits this fraction of a retry (up to a burst of 20 retries for a quiet replica) and every retry spends one, so a sustained failure is retried for at most this fraction of the calls plus the burst, however many tries -backend-retry-attempts allows. Retries stop (outcome budget_denied) when the budget is empty, the circuit breaker is the other brake: no retry is made while it is open or half opennone directly; a call whose retry the budget denied returns the error it would return without retriesloki_vl_proxy_internal_operation_total{operation="backend_retry"} (outcome budget_denied)nonenoproxy-specific
max query length bytes-max-query-length-bytesextraArgs.max-query-length-bytes131072bytesthe LogQL query string length400 parse error : input size too long (N > M) (Loki's text for a query above its input size limit; M is this limit); the request error log line names limit_flag=-max-query-length-bytes and limit_valueloki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsnosyntax.maxInputSize (131072): the default matches it, so the proxy rejects only what Loki rejects
max query ast nodes-max-query-ast-nodesextraArgs.max-query-ast-nodes0nodesthe size of a parsed query: every expression node (a log query, a range or vector aggregation, a binary operation, a literal, label_replace and the expression inside it), every pipeline stage and every stream selector matcher. Parentheses create no node. The limit is checked once the query has been parsed, ahead of the response cache, and bounds what the proxy does next (planning, translation and the VictoriaLogs work); it does not bound the parse itself. 0 (the default) derives the limit from -max-query-length-bytes, the length limit in effect: a query that parses has at most as many nodes as bytes (logql.Complexity; FuzzComplexityBoundedByLength holds it), so the derived limit refuses nothing that limit accepts, and a query shorter than the limit is not walked at all400 query too complex: too many nodes (the proxy's own text, with no number: Loki has no such limit); the request error log line names limit_flag=-max-query-ast-nodes and limit_value, and its upstream_error says how many nodes the query hasloki_vl_proxy_query_complexity_rejections_total{limit="ast_nodes"}LokiVLProxyHighClientErrorsnonone: Loki has no node, depth or planning limit below its 128 KB input size limit (syntax.maxInputSize, 131072). Its parser accepted 65,000 nested parentheses, 26,000 nested sum( calls, 65,000 binary operands, 20,000 nested (... + 1) and 3,000 | json stages (Loki 3.7.9 parser oracle). This limit is an intended proxy-only difference, off by default (registry decision query-complexity-limits)
max query nesting depth-max-query-nesting-depthextraArgs.max-query-nesting-depth0levelsthe nesting depth of a parsed query: the longest chain of nested expression nodes (a literal or a log query alone is 1, sum(rate({a="b"}[1m])) is 3). Parentheses create no node, so they add no level. The limit is checked once the query has been parsed, ahead of the response cache, and bounds what the proxy does next; it does not bound the parse itself. 0 (the default) derives the limit from -max-query-length-bytes: a query that parses is at most as deep as it is long (logql.Complexity), so the derived limit refuses nothing that limit accepts, and a query shorter than the limit is not walked at all400 query too complex: nesting too deep (the proxy's own text, with no number: Loki has no such limit); the request error log line names limit_flag=-max-query-nesting-depth and limit_value, and its upstream_error says how deep the query isloki_vl_proxy_query_complexity_rejections_total{limit="nesting_depth"}LokiVLProxyHighClientErrorsnonone: Loki has no nesting-depth limit below its 128 KB input size limit; the shapes its parser accepted are listed under -max-query-ast-nodes (26,000 nested sum( calls are 26,000 levels). An intended proxy-only difference, off by default (registry decision query-complexity-limits)
max query plan time-max-query-plan-timeextraArgs.max-query-plan-time10sdurationthe proxy's own work on one request before it asks VictoriaLogs: the validation misses of the request's query (parser, semantic pass, tree checks) and its translation (the query plan's lowering, or the string translator where it falls back). Admission and queue waits, cache reads and VictoriaLogs calls are not counted, and a query answered from the validation and translation caches costs the request none. It is checked while the query is validated (the parser, the parsers it makes for the calls it reads again and its semantic pass ask every 256 steps, tokens read and tree nodes walked, after the first 1,024; once it has run out the parse still reads to its end, so a syntax error is answered with Loki's error, and the checks over the tree stop, so the trip answers only a query that parses; the walk of the tree checks asks every 256 nodes), after the validation, at every node of the lowering, right after the string translator returns, and before the first VictoriaLogs call of the request (not before a native tail's own stream call, made after the websocket upgrade). The string translator is not interrupted while it runs: its time is counted once it returns, at the next check. A query the validation cache holds costs the request no budgeted work. A query too long to cache (over 4 KiB), or short but met while the shared validation cache holds its 1,024 entries, is validated by the route's own validator instead of ahead of it, so as not to be parsed twice: query and query_range count that validation toward the budget, the selector routes (labels, series, volume and the like) do not; 0 turns the budget off400 query planning took longer than the limit (the proxy's own text: Loki has no such limit); the request error log line names limit_flag=-max-query-plan-time and limit_value (nanoseconds) and says which check noticed it. Nothing of the request is kept: its validation, plan and translation are not stored, and a repeat plans againloki_vl_proxy_query_complexity_rejections_total{limit="plan_time"}LokiVLProxyHighClientErrorsnonone: Loki has no planning-time limit; its parser accepted the deep shapes listed under -max-query-ast-nodes, at 13 s of CPU and 560 MB RSS for that batch. An intended proxy-only difference (registry decision query-complexity-limits)
default max query length-default-max-query-lengthextraArgs.default-max-query-length721h0m0sdurationthe query time range accepted for every tenant unless a per-tenant limit overrides it; 0 turns the limit off, as Loki's max_query_length: 0 does400 the query time range exceeds the limit (query length: X, limit: Y)loki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsyes (-tenant-limits)max_query_length (Loki's default 721h, published as 30d1h, is the default); a multi-tenant request is held to the smallest non-zero value of its tenants
multi tenant max fanout-multi-tenant-max-fanoutextraArgs.multi-tenant-max-fanout64tenantstenants one multi-tenant request may fan out to400 limit reached while evaluating the query (the class of Loki's query limits); the request error log line names limit_flag=-multi-tenant-max-fanout and limit_value, and its upstream_error says multi-tenant fanout exceeds limit of N tenants; raise -multi-tenant-max-fanout or query fewer tenantsloki_vl_proxy_requests_total{status="400"}LokiVLProxyHighClientErrorsnoproxy-specific
multi tenant max merged response bytes-multi-tenant-max-merged-response-bytesextraArgs.multi-tenant-max-merged-response-bytes33554432bytesthe merged response of a multi-tenant request500 rpc error: code = ResourceExhausted desc = grpc: trying to send message larger than max (N vs. LIMIT) (Loki's text for a response above its message size; Loki's read API has no 413); the request error log line names limit_flag=-multi-tenant-max-merged-response-bytes and limit_valueloki_vl_proxy_requests_total{status="413"}nonenoproxy-specific
binary metric max operand bytes-binary-metric-max-operand-bytesextraArgs.binary-metric-max-operand-bytes268435456bytesoperand bytes one binary metric expression may capture400 limit reached while evaluating the query (the class of Loki's query limits); the request error log line names limit_flag=-binary-metric-max-operand-bytes, and its upstream_error says binary expression exceeds its evaluation budget; narrow the query or increase -binary-metric-max-operand-bytesloki_vl_proxy_requests_total{status="400"}nonenoproxy-specific
binary metric max arrays-binary-metric-max-arraysextraArgs.binary-metric-max-arrays2000000arraysJSON arrays one binary metric expression may allocate while joining operands400 limit reached while evaluating the query (the class of Loki's query limits); the request error log line names limit_flag=-binary-metric-max-arrays, and its upstream_error says binary expression exceeds its evaluation budget; narrow the query or increase -binary-metric-max-arraysloki_vl_proxy_requests_total{status="400"}nonenoproxy-specific
detected fields max scan lines-detected-fields-max-scan-linesextraArgs.detected-fields-max-scan-lines2000rowslog lines the detected_fields and detected_field values scan reads per requestnone: the scan stops at the limit and returns what it foundnonenonenoproxy-specific
patterns max backend rows-patterns-max-backend-rowsextraArgs.patterns-max-backend-rows20000rowslog lines /patterns reads from VictoriaLogs for one requestnone: pattern mining works on the rows it readloki_vl_proxy_patterns_lines_scanned_totalnonenoproxy-specific
patterns second pass max rows-patterns-second-pass-max-rowsextraArgs.patterns-second-pass-max-rows8000rowslog lines the /patterns second pass reads when the first pass mined too few patternsnoneloki_vl_proxy_patterns_lines_scanned_totalnonenoproxy-specific
patterns max counts rows-patterns-max-counts-rowsextraArgs.patterns-max-counts-rows250000rowsrows the /patterns counts query reads from VictoriaLogs: distinct (step, level fields, collapsed message) groups over the requested rangenone: past it the request samples lines as without -patterns-countsnonenonenoproxy-specific
patterns exact max lines-patterns-exact-max-linesextraArgs.patterns-exact-max-lines200000lineslog lines the /patterns exact reading takes from VictoriaLogs for a stream selector's range, to mine Loki's patterns from the lines themselves, each stream and level apart; a range with more lines is answered from VictoriaLogs' counts instead, which mines a level's streams togethernone: a range with more lines, or a reading VictoriaLogs fails (its sort of the lines runs out of memory), is answered from the counts as with the reading offnonenonenopkg/pattern mines every line of every stream it ingested; the exact reading is that mining on the lines VictoriaLogs holds
patterns state max bytes-patterns-state-max-bytesextraArgs.patterns-state-max-bytes268435456bytesmemory the /patterns state of all tenants holds: each stream's clusters at each level and their 10 s samples over Loki's pattern retention (3h)none: past it the least recently used tenant's state is dropped and built again on its next requestloki_vl_proxy_internal_operation_total{operation="patterns_state"}nonenopkg/pattern keeps each stream's clusters in the pattern ingester's memory for retain_for (3h); the state keeps the same for the streams the proxy's selectors read
patterns state max build lines-patterns-state-max-build-linesextraArgs.patterns-state-max-build-lines2000000lineslog lines over Loki's pattern retention (3h) the /patterns state of a selector is built from in the background, when they are more than -patterns-exact-max-linesnone: a selector with more lines is answered from VictoriaLogs' counts, without the stateloki_vl_proxy_internal_operation_total{operation="patterns_state",outcome="build_started"}nonenopkg/pattern mines every line of every stream as it is ingested; the background build mines the selector's lines over the same retention once, then refreshes train only new lines
patterns state stream idle-patterns-state-stream-idleextraArgs.patterns-state-stream-idle5m0sdurationhow long a stream of the /patterns state reads no line before only its patterns and samples are keptnonenonenonenoproxy-specific
patterns second pass max windows-patterns-second-pass-max-windowsextraArgs.patterns-second-pass-max-windows8windowswindows the /patterns second pass re-readsnonenonenonenoproxy-specific
max zero fill buckets-max-zero-fill-bucketsextraArgs.max-zero-fill-buckets32768bucketsbuckets the proxy zero-fills in a metric responsenone: a wider request is served without zero-fillnonenonenothe 11,000-point resolution limit bounds a Loki response anyway
stats query range concurrency-stats-query-range-concurrencyextraArgs.stats-query-range-concurrency0concurrent callsconcurrent stats_query_range calls the proxy makes to VictoriaLogsnone: calls wait for a slotloki_vl_proxy_upstream_requests_total{route="/select/logsql/stats_query_range"}nonenoproxy-specific
max concurrent-max-concurrentextraArgs.max-concurrent100requestsrequests admitted per replica, and concurrent backend operations429 too many outstanding requests (Loki's queue-full text) with Retry-After: 5; the request error log line names limit_flag=-max-concurrent and limit_valueloki_vl_proxy_requests_total{status="503"}LokiVLProxyHighErrorRatenoproxy-specific
translate shadow sample-translate-shadow-sampleextraArgs.translate-shadow-sample0ratiothe share of the queries the string translator translates (translation cache misses) that the typed query-plan lowering also translates, in the background, and compares with the translator's output: at most 2 comparisons run at once per replica (a sampled query that finds both busy is skipped), each is dropped after 100 ms, a panic is recovered, and the share never delays or changes the answer, the caches or a VictoriaLogs request; on the same share of their requests, the queries the proxy evaluates in part itself (a ranking, stddev or stdvar) are compared as a whole with what the proxy runs, from the operand request the handler has already sentnone; a sampled query that finds both comparison slots busy is counted as skipped and a comparison over its budget as budget; a difference from the translator is counted as mismatch and logged (the queries redacted) at most once per secondloki_vl_proxy_lowering_shadow_total{result="match|mismatch|new_error|old_error|not_lowered|skipped|panic|budget|native_proxy_evaluated|known_divergence",construct}nonenoproxy-specific
query plan lowering-query-plan-loweringextraArgs.query-plan-loweringtrueswitchwhich translator writes the VictoriaLogs query of a log query with a stream selector, line filters, pattern filters and label filters and no parser stage, and of a range function over an unwrapped label (alone or under one vector aggregation) whose series a keep before the unwrap decides, which the lowering groups by the labels the keep leaves as Loki does, and of sum, max, min or avg over a range function taken per series of an unwrapped label after a json or logfmt parser with no keep, which the lowering groups by the stream and a hash of each line's parsed labels as Loki's series (after an extraction list of plain keys such as | logfmt amount, route, by the stream, its stored level fields and the listed labels, with no second read of the line): true (the default) the typed query-plan lowering, false the string translator; every other query is always translated by the string translator, and a query the lowering cannot translate falls back to it. Nothing grows with the setting: the lowering is bounded by the query parser's own input limits and runs once per translation cache missnone; the translated query is the same text under either setting, except a keep before an unwrap and a function taken per series after a parser with no keep or after an extraction list, whose series follow Loki only with the lowering on. A lowering that panics is recovered, counted as panic and answered by the string translatorloki_vl_proxy_lowering_shadow_total{result="flipped",construct="LogSelect"}, and the same counter with construct UnwrapKeepIdentity for a keep before an unwrap and UnwrapDynamicIdentity for a function taken per series after a parsernonenoproxy-specific
query stats mode-query-stats-modeextraArgs.query-stats-mode"loki"modeloki (the default) or victorialogs: how the data.stats object of query, query_range, volume and volume_range answers is filled. Nothing grows with the setting: the stats object is a fixed-size rendering per answer, and Loki's accounting reads only the answer, the request and the volume answers the proxy already keepsnone; an unknown value stops the proxy at start-up with invalid -query-stats-modenonenonenodata.stats of Loki's query, query_range and index/volume answers
query stats exact metric bytes-query-stats-exact-metric-bytesextraArgs.query-stats-exact-metric-bytesfalseswitchfalse (the default) estimates a metric query's bytes processed from the selector's mean line size; true reads them from VictoriaLogs with one volume request per metric query cache miss, sent next to the query and bounded by itnone; a failed or cancelled volume request leaves the estimateloki_vl_proxy_backend_read_bytes_total{kind="stats"} counts the extra requests' bytesnonenodata.stats.summary.totalBytesProcessed of Loki's metric queries
query stats exact log lines-query-stats-exact-log-linesextraArgs.query-stats-exact-log-linesfalseswitchfalse (the default) estimates a log query's lines processed from its answer; true counts them with VictoriaLogs, one timestamp-only count request of the query's stream selector over the 1h pieces Loki reads, per log query cache miss that fills its limit or filters lines, sent after the answer and bounded by the requestnone; a failed or cancelled count leaves the estimateloki_vl_proxy_backend_read_bytes_total{kind="raw"} counts the extra requests' bytes (one row each)nonenodata.stats.summary.totalLinesProcessed of Loki's log queries
json line fields as line keys-json-line-fields-as-line-keysextraArgs.json-line-fields-as-line-keysfalseswitchhow a row whose _msg is VictoriaLogs' missing-message placeholder (its -defaultMsgValue, or -backend-default-msg-value) is read: a JSON line pushed to VictoriaLogs' Loki push route without disable_message_parsing=1, which VictoriaLogs stores as one field per key. false (the default) reports every stored field of such a row as structured metadata (parsed labels after | json or | logfmt); true reads every one as a key of the row's JSON line, as Loki holds the pushed line: no label until | json or a json extraction list reads it, none from | logfmt (an extraction list's names empty), and a query whose every log selector reads a label no stage can give such a line (an unwrap, or a label filter an empty value fails, after | logfmt or without a parser) leaves those rows out with one extra_filters filter on the rows' stored _msg, which VictoriaLogs evaluates before the query's pipes. Nothing grows with the setting: the reading is per row, from the fields VictoriaLogs already returnsnone; with true, structured metadata pushed beside such a line is hidden, because VictoriaLogs stores it among the line's keys and cannot tell them apart, and so are the fields of every other row VictoriaLogs stored without a message (jsonline rows and OpenTelemetry map bodies without one, attributes included). It acts in the Loki-compatible profile only (-label-style=underscores, -metadata-field-mode=translated, the defaults)nonenonenothe labels and samples Loki's pipeline takes from a pushed JSON line (profiles/json-line-stored-without-line)
max lines-max-linesextraArgs.max-lines100rowsthe default number of log lines per query when the client sends no limitnonenonenoneyes (-tenant-limits)Loki's default limit of a log query (100); Grafana sends its Max lines (1000) as the limit

Sizingโ€‹

-backend-max-concurrent-heavy-queriesโ€‹

VictoriaLogs lets each stats pipe of one query use up to 40% of -memory.allowedPercent, so 2 keeps concurrent stats state inside its budget. Raise it with VictoriaLogs memory (the fleet total is replicas x this value); lower it to 1 for a VictoriaLogs under 2 GiB.

-backend-max-concurrent-metadata-scansโ€‹

What one scan costs depends on the data, so each replica learns the limit instead of being sized: on the e2e stack (7-day retention, 18 million rows) a 7-day stream_field_names scan holds 0.8 GiB and took 9-35 s alone, and seven at once from seven replicas each ran past VictoriaLogs' 60 s limit and OOM-killed it, while a backend with cheap scans lets the limit reach the ceiling. Because others' selects count against it, the limit bounds the fleet, not one replica: a simulation of eleven replicas warming up together stays under the memory budget where a static 2 each kills the backend. Raise the ceiling only for a VictoriaLogs with many cores and memory to spare; lower it to cap how many long scans any replica starts. 0 disables the limiter.

-backend-min-concurrent-metadata-scansโ€‹

1 serves a slow backend serially instead of not at all. Raise it only when a backend that is known to have headroom is being held too low by noisy latency (for example 2 on a VictoriaLogs cluster). Must be at most the ceiling; 0 uses the default.

-backend-metadata-scan-memory-headroomโ€‹

0.4 leaves 40% of VictoriaLogs' memory to its page cache (VictoriaLogs reads its parts through it), ingestion, the queries the proxy does not gate and scans whose memory is still building up; the memory in use already includes the caches VictoriaLogs is allowed (-memory.allowedPercent). On the e2e stack (8 GiB container, 3 GiB caches) 0.3 let memory in use reach 5.4 GiB and the resident set 5.7 GiB with eleven replicas starting together; the container also holds about a gigabyte of page cache. Raise it (0.5) when VictoriaLogs also serves other clients or runs close to its limit; lower it (0.2) on a dedicated node with a large limit. 0 disables the memory gate and the brake and leaves the latency, failure and select-slot feedback. A backend whose /metrics has no vl_concurrent_select series (a vmauth in front of VictoriaLogs) turns the memory gate off by itself: that process's memory says nothing about VictoriaLogs.

-backend-metadata-scan-latency-toleranceโ€‹

1.5 tolerates the slowdown of a second concurrent scan on a CPU-bound VictoriaLogs (measured 1.45x) and reacts to a third (1.9x). Lower it (1.2) to keep label browsing snappy at the cost of concurrency; raise it (2-3) when scan durations are noisy for other reasons (shared disks, ingestion bursts). Must be >= 1; 0 uses the default.

-metadata-inventory-parallelismโ€‹

4: VictoriaLogs already spreads one query over its cores, so more buys little on a cold window (three concurrent 7-day scans took 1.8x as long as one on the e2e stack) while a warm window needs only its two edges. Lower it to 1-2 for a small VictoriaLogs; the day bucket scans of a long listing also take -backend-max-concurrent-metadata-scans slots, each only while its own call runs. 0 turns the inventory off: every listing is one VictoriaLogs call over the whole range, as before. The same bound applies to the segment reads of an instant /index/volume (see -max-stats-cache-freshness), and 0 turns those off too.

-max-stats-cache-freshnessโ€‹

10m, Loki's default: a Logs Drilldown refresh reads the last 10 minutes and the few seconds the window start moved from VictoriaLogs, and the rest of a 24h window from the cache. Raise it to read more of the recent past live (rows that arrive later than the freshness window show up when their segment is re-read: within the labels TTL for the last hour, up to an hour for older segments); lower it, down to 0 (every segment but the newest minute is kept), to read less.

-peer-replication-factorโ€‹

2: one replica can lose its disk, restart or stop without its keys being computed again (an owner that lost its disk reads them from its backup, one peer round trip per key; other replicas reach the backup within -peer-timeout while the owner is down). Each replica holds a full copy, so the fleet keeps memory and disk times the factor per key (measured with 4 KiB values: 8.2 KiB of memory and 14.6 KiB of disk per key at 2, 4.1 and 8.5 at 1) and, with a fixed -cache-max-bytes, the fleet's distinct keys divide by the factor (a two-replica fleet at 2 holds every key on both). Every write-through write pushes factor minus one copies (4,096 bytes on the wire per 4 KiB write at 2). A lookup on a key no replica holds asks up to factor minus one peers before computing it, each bounded by -peer-timeout. 1 keeps one copy on the owner (the behaviour before this flag); 3 survives two losses at a third more memory and disk.

-peer-read-hedge-max-delayโ€‹

200ms: on a healthy fleet the measured delay sits far below it (twice a header p99 of a few milliseconds), so about one read in a hundred asks a second replica and the fleet's peer reads grow by about 1%; the maximum only applies before the latencies are measured and when the fleet is slow, where it bounds what a paused replica costs one request (200 ms instead of the 2 s peer timeout, then nothing while the peer is suspended). Lower it (50ms) to bound that cost tighter at the price of more VictoriaLogs reads when every replica is slow; raise it towards half of -peer-timeout when peers sit far away (cross-region) and VictoriaLogs is expensive. 0 turns hedging off: a read waits up to -peer-timeout on each replica, as before this flag.

-peer-push-buffer-max-entriesโ€‹

8192: a proxy writing 200 eligible entries a second at -peer-replication-factor=2 sends about 200 pushes a second to its other replicas, so one peer down for the 10 s breaker cooldown needs at most about 2,000 entries before coalescing; 8192 covers about 40 s of a full write stream to one peer that is down, or several peers down at once. The budget is per proxy, not per peer, so it does not grow with the fleet. Raise it for proxies that write faster or peers that restart slowly (memory is the values' size, see -peer-push-buffer-max-bytes, plus about 200 bytes per entry); lower it to bound memory tighter. 0 turns buffering off: a push a peer cannot take is dropped and counted, as before this flag.

-peer-push-buffer-max-bytesโ€‹

32 MiB: 8,192 entries of 4 KiB, a typical stats extent or label answer; half the push queue's 64 MiB, so the two together stay under 100 MiB of a proxy's memory. Values above 8 MiB are never pushed. Raise it with -peer-push-buffer-max-entries for proxies that push large window answers; 0 turns buffering off.

-backend-heavy-query-queue-waitโ€‹

Keep it below the Grafana data source timeout (30s by default) so a queued panel fails with the documented 429 instead of a client timeout. Raise it when dashboards have more heavy panels than slots; lower it to shed load earlier.

-backend-heavy-query-min-rangeโ€‹

Lower it (for example 1h) when short ranges already strain VictoriaLogs; raise it when only multi-day queries need queueing.

-manual-range-metric-row-limitโ€‹

Proxy memory is about 100 bytes per stats row and about 32 bytes per raw sample, so the default bounds one evaluation to roughly 100 MiB. Raise it for high-cardinality groupings over days; lower it to reject expensive scans earlier. On the chunked extraction-list windows a lower value does not reject: it makes the chunks smaller (more VictoriaLogs calls, each reading the range before its chunk again) and lowers the proxy memory one chunk holds.

-error-cache-transient-ttlโ€‹

1s: in a measured storm (20 clients refreshing one failing query every 100 ms through a 3 s outage, internal/proxy TestErrorCacheTTLSweep) 0 let 439 calls/s reach VictoriaLogs on /labels and 198-394/s on query_range with end=now, 0.5s 4-9/s, 1s 1.3-4/s and 2s 1-2.7/s; the first answer after VictoriaLogs recovered came within the TTL (under 50 ms at 0.5-1s in those runs, about 1 s at 2s). A VictoriaLogs 5xx or 429 or a refused or reset connection is held for every window of the same query (refreshes move end=now); a 5xx specific to one window can then fail the query's other windows for up to this TTL. Raise it (2-5s) to shield a VictoriaLogs that is slow to recover from refresh storms, at the cost of answering a failure that long after recovery; 0 holds none (followers in flight still share).

-error-cache-data-ttlโ€‹

5s: the same window fails the same way until new lines arrive (a moving window has new bounds, so a new key), and each such answer reads the window's lines or series again; 5 s keeps a refresh loop from re-reading them while a dashboard that changes its window answers at once. Raise it for heavy JSON metrics over settled windows; 0 holds none.

-error-cache-vl-refusal-ttlโ€‹

5m: the same text on the same VictoriaLogs release is refused the same way until the proxy build, its configuration or the VictoriaLogs release changes, each of which changes the key; the hold only bounds an operator change of a VictoriaLogs limit without a release change (a raised -search.maxQueryLen keeps being refused this long, and the length the proxy learned from a refusal is trusted as long). With peer sync a fleet of N replicas sends about one VictoriaLogs call per refused query per hold instead of one per request (TestVLRefusal_FleetSendsOneCallPerHold: 3 replicas x 5 refreshes, 1 call). Below 30s nothing is pushed to peers (a push takes about a second); 0 holds none (followers in flight still share).

-error-cache-max-entriesโ€‹

4096 failing requests per TTL is far above any dashboard storm; a flood of distinct failing queries only evicts held failures, never cached successes (the error cache is its own bounded store). 0 uses the default.

-error-cache-max-bytesโ€‹

8 MiB: Loki's error texts are under 1 KiB (a parse error quotes the query, bounded by Loki's input size), so 8 MiB holds every entry the entry cap allows. 0 uses the default.

-max-stats-query-seriesโ€‹

The default is 1,000, above Loki's 500: the proxy answers faster than Loki, so it affords more series per query, and Logs Drilldown gets 1,000 series with the partial-result warning instead of 500. Set 500 (or max_query_series 500 in the tenant limits) to match Loki. Raise it for dashboards that legitimately render thousands of series, at the cost of response size and browser rendering; topk and bottomk rank every series regardless of this cap. Raise -backend-max-buffered-response-bytes with it: this cap is what usually keeps a result inside the byte budget, so raising it alone converts Loki's series-limit error into Loki's message-size error (rpc error: code = ResourceExhausted ...; the log line names -backend-max-buffered-response-bytes). Budget about 40 bytes per sample plus about 100 bytes per series - series x steps x 40 bytes - so 64 MiB holds roughly 1,500 dense series over a 1,000-step range. The 1,000 default over 1,000 steps is about 40 MB, inside the 64 MiB default; at more than about 1,600 steps a full 1,000-series result needs -backend-max-buffered-response-bytes raised with it (or a lower cap). On the e2e stack sum by (pod) (rate({service_name="api-gateway"}[5m])) over 7d covers about 240,000 distinct pods: with a cap of 500 it answered 491 series in 0.5s, and at 1,000,000 it exceeds 64 MiB and returns 500.

-drilldown-series-limit-modeโ€‹

The default is loki, Loki parity: a Drilldown panel over the limit shows what deployed Loki shows, often only the first steps of each hour (one step per hour when every series starts at once, as in a breakdown of busy streams). Choose busiest for full-range charts of the busiest series instead; both modes cost the same VictoriaLogs calls (one ranked read of limit+1 values by line count, or by first line per split).

-drilldown-series-limit-split-intervalโ€‹

Set it to the Loki the proxy stands in for (1h is Loki's default; larger tenants often run 15m-30m). The same value for every replica and peer: the cache key carries it. A Drilldown answer over the limit over N splits holds up to N times the limit series; VictoriaLogs still answers in one ranked read (sort ... partition by (_time) limit), returning at most limit+1 values per bucket of a grid with an edge at every split's first step (one bucket per split when the interval is a multiple of the step). A step shorter than the interval that does not divide it (a 7s step against 1h; no Grafana $__auto step) would need a bucket per step: when that is more than 2x(splits+1) buckets the request is not ranked, a range == step answer reads its whole answer (Loki's message size error past -backend-max-buffered-response-bytes) and an answer too large for one read answers that error.

-drilldown-series-limit-instant-split-intervalโ€‹

Set it to the Loki the proxy stands in for (1h is Loki's default); 0 keeps the warning on every Drilldown instant answer over the limit.

-ordered-json-metric-max-bytesโ€‹

The default admits about one million rows of 1 KiB. Rows are streamed, so raising it costs VictoriaLogs scan work and network transfer rather than proxy memory; lower it to protect VictoriaLogs from long raw scans.

-label-filter-refill-max-pagesโ€‹

Each page is one more VictoriaLogs request of at most limit rows. The default of 8 fills a page unless the newest 9 x limit rows of the window are almost all JSON lines holding the filtered key, the case Loki answers with fewer lines too. Raise it for streams where structured metadata named like a JSON key is rare; lower it, or set 0, to bound VictoriaLogs reads to one page per request.

-backend-max-buffered-response-bytesโ€‹

Proxy memory grows with this value times the requests that buffer a response at once, so treat it as per-request memory: 64 MiB x -max-concurrent is the worst case. With -query-range-extent-cache on, a metric request whose stats answer is not cached yet also keeps one copy of it while it is read, for the cache to store split by split, so such a request can hold up to twice this value. Raise it for very wide stats responses; lower it on small replicas. It is the second half of -max-stats-query-series: the series cap decides how many series a result may carry, this decides whether the encoded result fits. Raising either one alone moves the failure rather than removing it - a high series cap with the default byte budget fails with Loki's message-size error (rpc error: code = ResourceExhausted ..., the log line names -backend-max-buffered-response-bytes) instead of the series-limit error. Size it as series x steps x 40 bytes for the widest chart you intend to serve, then check the replica has that much memory per concurrent request.

-max-entries-limit-per-queryโ€‹

Raise it for clients that ask for more log lines per request; lower it towards Loki's 5000 to bound response size. Grafana asks for its Max lines setting (1000 by default), well below the default.

-label-values-max-response-bytesโ€‹

The VictoriaLogs response carries a hit count per value, so it is about 1.7x the Loki JSON answer: on the e2e stack pod values for {env="production"} are 2.4 MB from VictoriaLogs (1.4 MB of Loki JSON, 54,405 values) over 1h and grow with the window, about 53 MB for 24h. The 64 MiB default (the same per-response budget as -backend-max-buffered-response-bytes, 16x Loki's default message size) admits about 1.4 million such values, so a day of a high-churn label still answers, while Loki on the same stack already fails the 1h request. While an admitted response is decoded, indexed and encoded, proxy memory holds a small multiple of it (the body, the decoded values and the Loki JSON) per concurrent request. Lower it towards 4 MiB to fail where Loki's defaults would; raise it only with replica memory, since Grafana's label pickers cannot render lists of that size anyway.

-metadata-max-stalenessโ€‹

10s: VictoriaLogs makes ingested rows searchable within about a second (rows buffer flush, lib/logstorage/datadb.go:776 in v1.49.0, :780 in v1.53.0), and Grafana's shortest dashboard refresh is 5s (min_refresh_interval), so a new label or value shows at most two refreshes late. Lower it for live-tail label pickers; 0 makes every near-now answer exact and lets it wait for VictoriaLogs. Values below -recent-tail-refresh-max-staleness add nothing: answers younger than that are served as cached anyway.

-metadata-edge-refresh-budgetโ€‹

100ms: an idle VictoriaLogs answers the edge listing in 5-40 ms (p95 of /labels on an idle e2e stack), so answers stay exact; under 32 heavy clients stream_field_names took 0.35-0.6 s at p95 and up to 2.6 s, which the budget turns into bounded-stale answers. Raise it to prefer exact answers over latency; 0 serves the last answer at once whenever one is within the bound.

-tail.settle-delayโ€‹

5s (VictoriaLogs' default tail offset): covers a rows-buffer flush plus a tail refresh with room for a loaded single node and for clients that batch their pushes. 1-2s covers one single-node buffer flush only, not clients that batch their pushes or a cluster vlinsert hop, so lines can be lost; raise it (10s and more) behind a vlinsert that buffers longer. 0 reads up to now: lowest latency, and lines that become searchable out of order are lost for good. The polled tail reads at most 200 rows per poll either way.

-tail.backend-retry-windowโ€‹

30s covers a VictoriaLogs restart (seconds to tens of seconds until it answers again) and the switch of one replica behind a service during a rolling upgrade, which is what a tail has to ride out; Grafana's live view does not reconnect by itself, so a tail closed by a short restart stays blank until the user reopens it. Each waiting tail makes at most one VictoriaLogs call per 2.5 s once its wait reaches the 5 s cap (a poll or a reopen, 24 per minute at most), so tens of proxies with hundreds of tails each add a bounded load to a backend that is coming back, spread by the jitter, and a tail holds one goroutine and a few KiB while it waits (no rows are buffered). Raise it (2-5m) for a backend that restarts slowly or fails over; lower it, or set 0, where a client should learn of an outage at once or a front proxy already retries.

-backend-retry-attemptsโ€‹

2 rides out a connection reset, a node leaving a cluster or a front proxy that lost a backend for under a second (waits of about 0.1-0.2 s and 0.2-0.4 s on the default 200 ms start); it does not ride out a restart of seconds, which the circuit breaker and the client's own refresh handle. Every retry is one more call to VictoriaLogs, so the count is bounded per call here and per replica by -backend-retry-budget-ratio: tens of replicas in front of one cluster add at most the ratio to its load while it fails. The log-range windowed query_range path keeps its own per-window retries, which stack with these (the budget bounds the extra calls). 0 disables.

-backend-retry-max-waitโ€‹

5s keeps a retried call well inside Grafana's default 30 s query timeout and -backend-timeout, and covers the default two tries (at most 0.2 s and 0.4 s of wait, longer only for a Retry-After). The heavy-query slot or metadata scan slot of the call stays held while it waits, so raising it holds those slots longer under failure; lower it where a client should fail fast.

-backend-retry-budget-ratioโ€‹

0.1 keeps retries to a tenth of the calls: an outage of VictoriaLogs makes each replica add at most one call in ten, so tens of replicas cannot double the load of a cluster that is already failing. Raise it (0.2-0.3) for a backend that fails in short bursts at a low request rate; 0 leaves only the burst of 20, which is spent in a failing minute and earned back by 200 healthy calls.

-max-query-length-bytesโ€‹

Lower it to reject generated queries earlier; raising it above Loki's own limit has no effect, because Loki's parse error fires first.

-max-query-ast-nodesโ€‹

The default is Loki's own bound (nothing below the input size limit), so no query Loki accepts is refused. Set it only to refuse generated or abusive queries before the proxy plans and translates them: real dashboard queries stay far below 1,000 nodes (the largest of the 2,585 valid queries of the plan corpus has 21). It is a bound on what follows the parse, not on the parse.

-max-query-nesting-depthโ€‹

The default refuses nothing Loki accepts. Real queries nest a few levels (the deepest of the 2,585 valid queries of the plan corpus is 8). Lower it (50-100) to refuse generated queries before the proxy plans and translates them; it does not bound the parse.

-max-query-plan-timeโ€‹

10s is above the slowest planning work measured, with the reasoning in the registry decision query-complexity-limits (as of 2026-11-18, commit 8e80a32b7, Apple M5 Pro, GOMAXPROCS=4, go test -v -run TestPlanBudgetDefaultNeverTripsOnTheCorpus ./internal/proxy, with LVP_PLAN_TIME_DEEP=1 for the deep shapes): the slowest of the 2,708 plan corpus queries plans in 0.4 ms; of the deep shapes Loki accepts, 26,000 nested sum( calls at 130 KB take 3.3 s on a quiet host, 6.2 s under load and 5.0 s under -race, all of it in the string translator (its validation takes 4 ms), and the other deep shapes take under 0.1 s. A follow-up moves the translation of nested vector aggregations onto the query plan, after which the default comes down. 10s is a twelfth of -backend-timeout (120 s). Lower it (1-5 s) to cut off abusive queries sooner: a real dashboard query plans in under a millisecond.

-default-max-query-lengthโ€‹

721h is Loki's default: a client gets Loki's answer for a range longer than about 30 days. Raise it, or set 0, when users query a longer retention; per-tenant limits in -tenant-limits override it.

-multi-tenant-max-fanoutโ€‹

Each tenant in the list is a separate backend query, so this multiplies every other limit. Raise it only with matching VictoriaLogs capacity.

-multi-tenant-max-merged-response-bytesโ€‹

The merged body is held in proxy memory once per request; size it with -multi-tenant-max-fanout and replica memory.

-binary-metric-max-operand-bytesโ€‹

Raise it for wide binary expressions over many series; the bytes are held in proxy memory for the request.

-binary-metric-max-arraysโ€‹

Raise it together with -binary-metric-max-operand-bytes; both bound one request's peak allocation.

-detected-fields-max-scan-linesโ€‹

Raise it when Drilldown misses fields that appear late in a window, at the cost of a longer VictoriaLogs scan; -drilldown-scan-timeout still bounds the time.

-patterns-max-backend-rowsโ€‹

Raise it for sparse selectors where patterns are mined from too few lines; every extra row is VictoriaLogs scan work and proxy parsing.

-patterns-second-pass-max-rowsโ€‹

Raise it with -patterns-max-backend-rows; the second pass doubles the scan for hard selectors.

-patterns-max-counts-rowsโ€‹

Rows grow with distinct collapsed messages times steps; a templated service needs a few thousand per hour, a high-cardinality generator about 100000 per hour. Each row is a few hundred bytes from VictoriaLogs and one map lookup in the proxy (a message is mined once), so raising it costs transfer, not memory per raw line.

-patterns-exact-max-linesโ€‹

About 200 bytes of transfer per line, a count query first, and a sort of the lines by stream and time in VictoriaLogs' memory, while the proxy holds only the clusters (a few hundred per stream and level). The default 200000 bounds one request to about 40 MB of transfer; raise it for VictoriaLogs with memory to spare, lower it when its sorts are slow or exceed its memory. 0 turns the reading off.

-patterns-state-max-bytesโ€‹

About 4 KB per active stream and a few hundred bytes per idle stream (-patterns-state-stream-idle): 256 MB holds tens of thousands of active streams. Lower it on small proxies; raise it when many tenants or selectors are refreshed and states are dropped often. 0 turns the state off, so every request reads its range again.

-patterns-state-max-build-linesโ€‹

One build at a time, an hour of lines per VictoriaLogs read (a quarter hour when its sort runs out of memory), about 2 ยตs of proxy CPU per line; idle streams are folded as the build goes, so memory follows the active streams. The default 2000000 covers a busy selector's 3 hours; 0 leaves such selectors on the counts.

-patterns-state-stream-idleโ€‹

Short-lived pods stop writing for good; 5 minutes frees their clusters soon after. Raise it when streams pause for longer and should keep training the same clusters when they resume.

-patterns-second-pass-max-windowsโ€‹

Each window is one VictoriaLogs call; raise it only when pattern coverage over long ranges matters more than fanout.

-max-zero-fill-bucketsโ€‹

Rarely needs changing; it only bounds proxy-side allocation for zero-filled charts.

-stats-query-range-concurrencyโ€‹

Drilldown Fields fires about 30 of these at once; 4 keeps VictoriaLogs CPU steady. Heavy calls are additionally bounded by -backend-max-concurrent-heavy-queries.

-max-concurrentโ€‹

Size it with replica CPU and VictoriaLogs capacity; 0 disables admission entirely, which lets one client drive unbounded fanout.

-translate-shadow-sampleโ€‹

0 (off) is the default: the lowering is a development aid that tells when a construct can move from the string translator to the typed plan, and it answers nothing. A comparison costs the parse, plan and lowering of one query (about 4 microseconds and 3 KB of allocations, measured on a log query with a stream selector and two line filters) and only runs on a cache miss, so 1 is affordable for an investigation or a canary replica; lower it (0.01-0.1) on a replica that translates thousands of distinct queries per second. Watch not_lowered by construct for what the lowering does not cover yet and mismatch for what it gets wrong.

-query-plan-loweringโ€‹

On is the default: the lowering writes the string translator's text byte for byte on the whole query corpus under every translator profile (a CI gate), takes less CPU and fewer bytes per translation than the translator on the shapes it covers, and only runs on a translation cache miss. A query it does not cover (a metric query, a parser or formatting stage, a detected_level or service_name filter) is decided by a scan of its text and not planned. Turn it off (false) as a rollback if a translated query ever differs from the string translator's: compare -translate-shadow-sample=1 with it off to see the difference as mismatch counts by construct.

-query-stats-modeโ€‹

loki is the default: Grafana's query inspector and the Logs Drilldown footer show numbers close to Loki's for the same query (estimated where VictoriaLogs does not tell them, documented per field in the API reference). Set victorialogs to see what the proxy actually read from VictoriaLogs for each request, for example when sizing VictoriaLogs or comparing the proxy's own work across replicas.

-query-stats-exact-metric-bytesโ€‹

Off by default: reading the line bytes of a selector costs VictoriaLogs about six times a count over the same window (24h of every stream on the test stack: 0.55 s against 0.09 s), on every metric query cache miss. Turn it on only where exact bytes in Grafana's inspector are worth that VictoriaLogs time; the volume caches answer repeats.

-query-stats-exact-log-linesโ€‹

Off by default: the count reads only the timestamps of the selector's streams over the pieces read (about a volume query's VictoriaLogs time; 24h of every stream on the test stack: 0.09 s), but it is one more VictoriaLogs request for every log query cache miss on every replica, which a fleet multiplies by its replicas and clients. Turn it on where exact lines processed in Grafana's inspector are worth that load; repeats are cache hits and send none.

-json-line-fields-as-line-keysโ€‹

Off by default: the supported setup is to push JSON lines with disable_message_parsing=1 (or start VictoriaLogs with -loki.disableMessageParsing), which keeps the line and needs no flag. Turn it on only where JSON lines already reach VictoriaLogs' Loki push route with message parsing on and carry no structured metadata, for example Promtail or Alloy pushes of JSON logs, and no jsonline or OpenTelemetry rows without a message carry fields that must stay visible. VictoriaLogs must keep a non-empty -defaultMsgValue (its default), and a customized one is named with -backend-default-msg-value. Its VictoriaLogs cost is one exact match on _msg for the queries it restricts, measured in the pull request that added it; with the flag off the proxy sends exactly what it sent before. Line filters (|= and |~), label filters an empty value passes before any parser, and | logfmt grouping keys still read what VictoriaLogs stored (docs/KNOWN_ISSUES.md).

-max-linesโ€‹

Raise it only with -max-entries-limit-per-query; every line is transferred and rendered.

Worked examplesโ€‹

A small deploymentโ€‹

One proxy replica with 512 MiB, one VictoriaLogs with 2 GiB, a handful of Grafana users:

extraArgs:
backend-max-concurrent-heavy-queries: "1" # one heavy stats state fits in VictoriaLogs memory
backend-heavy-query-queue-wait: "25s" # still below Grafana's 30s data source timeout
backend-max-buffered-response-bytes: "16777216" # 16 MiB per buffered response
manual-range-metric-row-limit: "250000" # about 25 MiB of proxy-side samples
max-concurrent: "16"

A large, high-volume deploymentโ€‹

Three proxy replicas with 4 GiB each, VictoriaLogs with 64 GiB, dashboards over days:

extraArgs:
backend-max-concurrent-heavy-queries: "6" # 18 heavy calls fleet-wide; VictoriaLogs has the memory for them
backend-heavy-query-queue-wait: "20s"
backend-heavy-query-min-range: "12h" # only long ranges queue
backend-max-buffered-response-bytes: "268435456" # 256 MiB for wide stats responses
manual-range-metric-row-limit: "4000000" # high-cardinality groupings over 7d
max-stats-query-series: "5000"
max-concurrent: "256"