Skip to content

Latest commit

 

History

History
110 lines (78 loc) · 5.2 KB

system-bench.md

File metadata and controls

110 lines (78 loc) · 5.2 KB

system-bench Design

system-bench is the crate for the system level. It makes external data processing systems measurable by the harness in aqpbm-core. User runs it through approxbench benchmark-external.

There are three kinds of measurement at this moment:

  • periodic queries: queries evaluated again and again over a window, while data arrives
  • one-shot queries: queries asked once over loaded tables, as ClickBench asks them
  • write throughput: how many samples per second a system acknowledges under concurrent writers

Not every system supports every measurement:

System Periodic queries One-shot queries Write throughput
duckdb yes
clickhouse yes yes
postgresql (with TimescaleDB) yes
druid yes
pilotdb (over DuckDB) yes
victoriametrics yes
asapquery-backend yes
asapquery-precompute-engine yes
fake (for tests) yes

Input

User specify which system to measure and how to reach it by command line arguments. For each kind of measurement, user can check the options by:

approxbench benchmark-external run --help
approxbench benchmark-external one-shot-queries --help
approxbench benchmark-external write-throughput --help

What to run comes from a run directory: the workloads, and the plans if a system runs planned queries. scripts/plan-suite.sh prepares a run directory from a suite. scripts/one-shot-workload.sh and scripts/one-shot-clickbench.sh prepare one and run every system for one-shot queries. scripts/write-throughput-asapquery-precompute-engine.sh measures the write throughput of an ASAPQuery precompute engine.

Output

Each system's results are written to results/<system>/ in the run directory:

  • periodic queries: <workload>__<variant>.cell.json, and the arm's result beside it when the cell ran; each run also writes engine-run-<UTC>.json
  • one-shot queries: <workload>__<configuration>.one-shot.json
  • write throughput: write-throughput.jsonl

Reports join the results of every system:

  • approxbench benchmark-external report writes summary.csv, summary.md, accuracy.csv and scores.csv
    • --truth says what the answers are scored against: the answers of one system (<engine>/<variant>), or the ground truth each query declares (declared)
  • approxbench benchmark-external one-shot-report writes one-shot-summary.csv, one-shot-summary.md and one-shot-tables.csv

Major Components

Registry

registry has one entry per system. Each entry declares which measurements the system supports, the command line options each one needs, and how to build the adapter from them. approxbench benchmark-external only knows a system through this registry.

Adapters

Adapters are under engines_external, one per system. An adapter talks to the system: it loads data, sends queries and reads answers. An adapter never times anything; the harness does. The VictoriaMetrics, ASAPQuery-backend and ASAPQuery precompute engine adapters share a Prometheus Remote Write client and query client in prometheus_api.

Servers are started by scripts/extbench-up*.sh, except the ASAPQuery precompute engine. scripts/write-throughput-asapquery-precompute-engine.sh expects that engine already running, and takes its URL and process id. DuckDB and PilotDB are installed by scripts/install-*.sh.

Plan file translation

plan_file.rs reads an ASAPPlanner plan file. clickhouse.rs and victoriametrics.rs translate it into what that system can run. A plan step the translator has no rule for is refused, so the translator is also the check of what the system can run. What each system can run is written down for the planner in capabilities.

planeval

planeval plans each query of a workload with ASAPPlanner and runs the plan with ASAPPlanner's executor, in the same process. The use-case study uses it in two ways:

  • to run the five use cases without an external system
  • to compute the exact answers and score each system's answers, when the use cases run on systems (scripts/use_cases/run_use_case_on_systems.py)

It reads the use-case specs, scores the answers and writes its output through the usecase-study crate. It is the only part of system-bench that depends on ASAPPlanner or usecase-study, so it is built only with the planeval feature:

cargo build --release -p system-bench --features planeval

Its design is in planeval.

Interaction with aqpbm-core

An adapter implements a trait of the harness in aqpbm-core: EngineUnderTest for periodic queries and write throughput, and OneShotQueryEngine for one-shot queries. The harness pins threads, checks that cores are idle, reads CPU and memory, and repeats each step. The details are in aqpbm-core harness module.

Open questions

  • The use cases on systems still need planeval for the exact answers, so they depend on ASAPPlanner.
    • Scoring itself is in usecase-study and does not need ASAPPlanner, but the exact values of every query would need an exact evaluator of its own.