Skip to content

benchmark-external: InfluxDB 3 Core periodic-query lane (native, downsampled, approximate) - #293

Draft
zzylol wants to merge 2 commits into
mainfrom
feat/influxdb3-periodic
Draft

zzylol wants to merge 2 commits into
mainfrom
feat/influxdb3-periodic

Conversation

@zzylol

@zzylol zzylol commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds InfluxDB 3 Core as a periodic-query system of approxbench benchmark-external (engine influxdb3), so it runs the same suites (suites/showcase-1m, suites/showcase-1h) as ClickHouse, VictoriaMetrics and ASAPQuery-backend, as an end-to-end baseline.

Pinned: InfluxDB 3 Core 3.12.3 (revision 51f4ac865b, DataFusion 52.5), image influxdb@sha256:f8cd424eff20b584ce41b1ee72959261c4d1b700d2a97c0d21ff1b173b9b1b81 (influxdb:3.12.3-core). Core, not Enterprise: Enterprise needs a license key and adds nothing these queries use.

Three variants, used the way an InfluxDB user would (details and semantics in docs/influxdb3.md):

Variant How each query runs Exact
influxdb3.native SQL over the raw rows at query time (percentile_cont, Prometheus extrapolatedRate in SQL, …) yes (see below)
influxdb3.downsampled processing-engine plugin writes a per-query downsampled table at ingest; quantiles stay native (not decomposable) yes
influxdb3.approximate approx_percentile_cont (t-digest) for quantiles; other queries native quantiles no (substitutions)

A downsampled/approximate cell in which every query would run as in native is refused (NotRun, reason in the cell): quantile workloads in downsampled, sum/count/max/rate workloads in approximate.

What to review first

  • system-bench/src/engines_external/influxdb3_query.rs: the accepted PromQL shapes and the SQL of each shape and variant (window (T − w, T], rate extrapolation, bucket arithmetic).
  • system-bench/src/engines_external/influxdb3_server.rs: the engine: one install at a time (Core's 5-database limit), plugin calls at each data-time boundary, answers keyed by labels.
  • docs/influxdb3.md: where InfluxDB differs from the truth.

Where InfluxDB differs from the truth

  • percentile_cont rounds its interpolation fraction to 6 decimals (0.99 quantile of 1..60 is 59.409999, not 59.41): off by ≤ 1e-6 of the gap between neighbouring values (≤ 1.9e-7 relative on the 1m suite).
  • approx_percentile_cont (t-digest) does not interpolate as PromQL: within two ranks per series in the tests; up to 11% relative on the 1m suite (median 0.2–0.8%).
  • Line protocol cannot carry NaN/inf values; a label named time or value is refused.
  • Stored bytes are Parquet only: a suite replay is shorter than the server's WAL snapshot period, so they are 0; memory (cgroup) carries the data.
  • Downsampling: scheduled triggers run on wall-clock time, so the adapter calls the same plugin through a request trigger at each data-time boundary (its work is ingest work). Last-value / distinct-value caches don't answer windowed aggregates; not used.

Interfaces

+ engine `influxdb3` in system-bench/src/registry.rs (periodic queries)
+ --influxdb3-url <URL>, --influxdb3-request-timeout-seconds <S> (plus the shared --server-cgroup-directory / --server-ssh-host)
+ scripts/extbench-up-influxdb3.sh up|down <data-dir> <cores> <numa> <port> [name]   (LISTEN_HOST, IMAGE, MEMORY_LIMIT)
+ scripts/influxdb3-variants.sh <run-directory>   adds influxdb3.{native,downsampled,approximate} ("plans": false, "run_by_default": false)

Tests

  • Unit (cargo test -p system-bench --lib influxdb3): 13 pass (parser, SQL text, line protocol escaping, CSV, refusals).
  • Conformance against a real 3.12.3 server (tests/influxdb3_conformance.rs, --ignored --test-threads 1): 8/8 pass: left-open windows; sums/counts/maxima/avg (native = downsampled = hand values); quantile 59.41 / avg-of-quantiles 81.15; Prometheus rates with resets (x 1, y 417/299, z 642/299, w 1) native = downsampled; generated data (20 series, gaps, resets, a series without job) vs an independent reference evaluator for every shape at 13 times; refusals; the harness conformance kit; suite size (1,000 series × 10 min).
  • End to end: benchmark-external run over showcase-1m (all 3 variants, --runs 1), reported against ClickHouse clickhouse.equivalent-only results of the same workloads: every point present (no missing/extra) in every cell; native and downsampled max relative error ≤ 1.9e-7 (quantiles) and ≤ 7e-15 (others).
  • showcase-1h smoke (joint, sum_rate; all variants, --runs 1): all ran (sum_rate approximate refused by design), 0 missing points, downsampled = native; approximate max relative error 3.2% on joint.
  • cargo clippy -p system-bench -p aqpbm-cli --tests -D warnings, cargo fmt --check clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi

…sampled, approximate)

Adds engine influxdb3: an adapter that translates each suite query's
PromQL text into InfluxDB SQL and runs it on InfluxDB 3 Core 3.12.3
(pinned by image digest) in three variants: native SQL at query time,
processing-engine downsampled tables (exact), and approx_percentile_cont
for quantiles. Server script, variant script, docs and conformance tests
against a real server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1M6boFpwkpMtRc1FnZuYi
@zzylol zzylol added the enhancement New feature or request label Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant