Configuration¶
pqbench reads its configuration from ~/.pqbenchrc: an INI of named
profiles, in the shape of ~/.databrickscfg. The file is the normal place for
the endpoint, the credential, and the dialect. A flag overrides a setting for
one run. There is no separate setup command.
Quick start¶
Create ~/.pqbenchrc:
Every command now uses that profile:
The file holds a bearer, so keep it readable only by its owner:
Profiles¶
Each section is a profile naming an endpoint, a bearer, and a dialect. A
workspace can carry [unity] and [iceberg] profiles over the same endpoint:
[DEFAULT]
endpoint = https://dbc-abc123.cloud.databricks.com
token = dapi…
table_format = unity
[iceberg]
endpoint = https://dbc-abc123.cloud.databricks.com
token = dapi…
table_format = iceberg
[principal]
endpoint = https://dbc-abc123.cloud.databricks.com
client-id = 0123-4567
client-secret = …
table_format = unity
A profile may name a service principal's client-id and client-secret
(client_id/client_secret are the same keys) instead of a bearer; see
Service principal. A static
token wins when a profile carries both. Any key takes either spelling: its
hyphens and underscores name the same key (table-format is table_format).
The profile is chosen by --profile or PQB_PROFILE; without either,
pqbench uses [DEFAULT], or the only profile there is, and otherwise fails
naming the profiles it found.
The file is ~/.pqbenchrc, or the path PQB_CONFIG_FILE names. The
repository's examples/pqbenchrc is a committed copy of the file above with a
placeholder bearer:
Environment¶
The environment overrides the selected profile. It is for CI and ambient credentials, not the normal place to configure a workspace; prefer the file or a flag.
| Variable | Role |
|---|---|
PQB_CONFIG_FILE |
the configuration file to read (default: ~/.pqbenchrc) |
PQB_PROFILE |
the profile to run under |
PQB_ENDPOINT |
workspace URL, Unity OSS, or Iceberg REST base |
PQB_TOKEN |
bearer PAT (dapi-…) or OAuth token; catalog reads and vending |
PQB_CLIENT_ID / PQB_CLIENT_SECRET |
a service principal, minting the bearer when no token is set |
PQB_TABLE_FORMAT |
unity (the default) or iceberg |
DATABRICKS_HOST / DATABRICKS_TOKEN |
a lower-priority fallback for the endpoint and bearer |
DATABRICKS_CLIENT_ID / DATABRICKS_CLIENT_SECRET |
the same fallback for a service principal |
AWS_* |
object-store region and ambient credentials, read by the storage client |
A later layer wins, so the environment can override the profile. A command is
a stateless HTTP client: it mints a service principal's bearer when it needs
one and asks the catalog for a table's vended lease when it reads that table.
When many processes share one catalog, pqbench proxy is the one that caches
(tokens, vended credentials, catalog GETs) and paces (see The proxy).
Per-invocation switches are flags only, never environment variables: --fan-out,
--rps, --rate, --samples, --per-column, --output, and each command's
own switches.
Checking a configuration¶
There is no setup command. The first catalog listing is the check: it resolves the file, environment, and flags, mints a bearer when needed, and asks the endpoint the same question the walk asks first. A failure names the endpoint, the credential, or the answer.
Neither the client secret nor a bearer is printed.
Flags¶
Every connection setting is also a global flag, accepted before or after the subcommand:
--profile NAME--endpoint URL--token TOKEN--client-id ID/--client-secret SECRET--table-format unity|iceberg
See the CLI reference for each command's flags.
The proxy¶
pqbench proxy serves the configured endpoint through one local cache and one
pacer, and prints the URL to point PQB_ENDPOINT at:
$ pqbench proxy --endpoint https://dbc-abc123.cloud.databricks.com/api/2.1/unity-catalog
http://127.0.0.1:41021/api/2.1/unity-catalog
$ PQB_ENDPOINT=http://127.0.0.1:41021/api/2.1/unity-catalog pqbench list catalogs
| Flag | Role | Default |
|---|---|---|
--bind ADDR |
local address to listen on | 127.0.0.1:0 (an ephemeral port) |
--rps RPS |
upstream requests a second; 0 is unpaced |
15 under Unity, unpaced under Iceberg |
--ttl SECS |
how long a cached catalog GET stays fresh; 0 caches only tokens and credentials |
60 |
It takes the endpoint, token, and dialect from the same layers as every other
command, and it is what makes a walk's many processes one client: the cache and
the pacer are the proxy's, not each process's. pqbench-driver run starts it
itself for a run that reaches a catalog.
Driver settings¶
pqbench-driver run writes two bash scripts into its store and runs them:
walk.sh lists partitions and process-partition.sh processes one. It reads
its settings from the same run-control file, from [DEFAULT] or from the
section PQB_PROFILE names. The file is ~/.pqbenchrc, or the path
PQB_CONFIG_FILE names:
| Key | Role | Default |
|---|---|---|
step-timeout |
seconds one partition script may run before its process group is killed | 300 |
retained-version-count |
finished versions pqbench prune keeps per partition; a positive integer |
5 |
They change rarely, so they live only in the file: neither is a flag and
neither has an environment variable of its own. The command line carries what
changes per run (--jobs, --walk-period-seconds, --low-network), the file
what an operator sets once. The keys sit beside the profile's, and either side
ignores the other's.
A script that outlives step-timeout has its whole process group killed, so no
hung worker outlives its step and no .stage directory is left behind. The
walk is not bounded by it: it runs table after table, and a per-step limit
would kill a healthy walk halfway.
The store holds walk.sh, process-partition.sh, partitions.ndjson.zst (one
standard Zstandard frame of NDJSON, which zstdcat reads), _last_walk_time,
.jobs/ for the run in flight, and
{catalog}/{schema}/{table}/{partition}/{etag}/. A version's _etag and
_last_processed_time are its whole state: a matching etag with a processed
time makes the next run an instant no-op. A run is append-only, so older
versions stay until pqbench prune deletes them; --dry-run prints the paths
it would delete.
Example¶
The catalog levels read a profile; a single command can still override the endpoint or bearer for one run: